Code covered by the BSD License  

Highlights from
GRABIT

4.83784

4.8 | 37 ratings Rate this file 126 Downloads (last 30 days) File Size: 23.43 KB File ID: #7173
image thumbnail

GRABIT

by Jiro Doke

 

17 Mar 2005 (Updated 23 Jan 2007)

Extract (pick out) data points off image files.

| Watch this File

File Information
Description

GRABIT Extracts data points from an image file.

GRABIT starts a GUI program for extracting data from an image file. It is capable of reading in BMP, JPG, TIF, GIF, and PNG files (anything that is readable by IMREAD). Multiple data sets can be extracted from a single image file, and the data is saved as an n-by-2 matrix variable in the workspace. It can also be renamed and saved as a MAT file.

Following steps should be taken:
   1. Load the image file.
   2. Calibrate axes dimensions. You will be prompted to select 4 points on the image.
   3. Grab points by clicking on points. Right-click to delete a point. Image can be zoomed during this stage.
   4. Multiple data sets will remain in memory so long as the GUI is open. Variables can be renamed, saved to file, or edited in Array Editor.

Panning is achieved by clicking and dragging on the image. In addition to using the zoom button, there are keyboard shortcuts for zooming:
 <shift> - center view
 <a> - zoom in
 <b> - zoom out
 <space> - reset view

This code will also work for extracting data points from a tilted or a skewed image (even upside-down or mirrored). The calibration stage ensures that the imperfect orientation or quality of the image is accounted for.

The types of files that will most likely work are BMP, JPG, TIF, GIF (up to 8-bit), and PNG files. Basically, any format supported by the IMREAD is accepted.

GRABIT(FILENAME) will start the GUI program and open the image file FILENAME.
 
Type GRABIT('-sample') to load a sample image.

Created in MATLABĀ® R13. Tested up to R2006a

Acknowledgements
This submission has inspired the following:
SMIProm, INTERACTIVEMOUSE
MATLAB release MATLAB 6.5 (R13)
Other requirements Tested up to R2006b
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (44)
11 May 2005 Chen-Fen Huang  
02 Jun 2005 radha proddaturi

perfect... would suggest to improve on finding data automatically when clicked on any particular line on the image

02 Aug 2005 Siva Venkat

good piece of code. useful for retrieving data points from images.

18 Aug 2005 Dewa Arsa

A very good code. I have tried it, it works well.

22 Dec 2005 Tony Jones

The imshow command used at line 382 ('iH = imshow(A, map)') does not work in MATLAB R14 SP2. Replacing it with 'iH = image(A);
colormap(map);' solves the problem. Other than that a very useful but of code!

23 Dec 2005 Jiro Doke

Tony,
Thanks for the comment. I think the problem might be that you don't have Image Processing Toolbox. But nice suggestions, I'll update it with IMAGE command to be more compatible. It should be up in the next update. In the meantime, you can download the newest version from here:

http://www-personal.umich.edu/~jdokeh/my_mfiles.html

13 Feb 2006 Leo Medo

Sorry, but wenn I start your code, I can see only GUI. If I browse a filename (Load Image) - only a path and image name will be shown, but I can“t see anything... Please inform me what to do, thanks

27 Feb 2006 Dick Beresford

A very useful utility. Suggested additions and improvements are:
1) facility to deal with logarithmic as well as linear axes.
2) allow zoom function to work in calibration mode as well as in data grabbing mode so that axis limits can be defined more accurately.

02 Mar 2006 Jiro Doke

I have uploaded an improved version. It has a better zooming feature (also zoomable during calibration) and a click-n-drag panning feature. I have not yet implemented capability to deal with LOGARITHMIC axes, but that's on my to-do list.

30 Mar 2006 iman satria  
30 Mar 2006 John Terry

excellence! I am waiting for the next version which can deal with logarithmic axis. Good luck!

02 May 2006 Seis Errs

very useful tool. Thanks a lot.

03 Aug 2006 Nick Peters

Excellent tool. Thanks for posting.

10 Nov 2006 Lars Sundstrom

Extremely useful. Thank you very much for sharing.

18 Nov 2006 Cong Le  
12 Jan 2007 Hector Mancha

Very usefull,

07 Feb 2007 Pankaj Porwal

Just loved it. Very good interface also.

09 Feb 2007 Eduard van der Zwan

This is something I was looking for. Thank You. Tip: wouldn't it be nice to extract data point form graphs with logaritmic axes?

21 Feb 2007 Jean-Luc Dellis

Thanks a lot. Good Job.

26 Jun 2007 RAMAR RAMARAJ

for the last six month i am trying to extract the data from the image file. Now i got it. this is very well work for me and all (those who are working Scientific data processing).

06 Sep 2007 Avi Pal

Does not work. from the first line itself it says unexpected matlab operator..
please help.
i am using matlab 7.1.0.246 (R14)

06 Sep 2007 Avi Pal

Does not work. from the first line itself it says unexpected matlab operator..
please help. i think its not identifying 3d
i am using matlab 7.1.0.246 (R14)

11 Oct 2007 Amandine Cagnioncle

This script is a lot better than Datathief which I formerly used. It makes extracting data from figures easier and faster!

16 Oct 2007 Iomsn Egenson

This program is ingenious. It is extremely small, easy to use and yet so useful that it makes it the ultimate grab tool.

19 Oct 2007 Jhon Gonzalez

GREEEEAT,

Is it possible that in the preview box shows the position calibrated and the corresponding pixel?

I plan to use it to calibrate a video to follow a laser spot

30 Oct 2007 Lorenzo Luini

This is one of the best and most useful tool I found here: really compliments!

23 Dec 2007 Mikkel Pedersen

Super tool!

Need the capability to use log-axes though.

26 Mar 2008 Sigmund As

Excellent tool - best one of these I've used so far. Log axes? No problem, just type in the exponent as the calibration values.

Suggestions:
* Ask the user if the data should be adjusted if the user recalibrates after grabbing.
* If the scan is not perfectly horizontal it would be nice to have two adjustment points for each xmin, xmax, ymin, and ymax - i.e. support for rotated coordinate transformation.

04 Apr 2008 ghgf ghf  
26 May 2008 a c

GREAT GREAT GREAT WORK!!!!

23 Feb 2009 Brian

A very useful application.

02 Mar 2009 Donat-Pierre Luigi

This a great application. I would have one request. Would it be possible to calibrate to the image size, with origin at top left max Y at bottom-left and max X at top-right. It is very basic and not as general as the current calibration procedure using 4points.
I am having issues with zoom and ginput to get the coordinate of a point in an image to change the coordinate system to that point later on in pixel and physical units. Thanks.

17 Sep 2009 Torsten Vogel  
12 Jan 2010 Ram Lakshmi

Hello,

Thanks for this nice tool.
Instead of point, can I get an area by marking a particular region in the bit map.
Regards
Ram

03 Jun 2010 Enrico

Nice Gui, but miss an automatic curve recognition. I'm also using reverseplot
(http://www.mathworks.co.uk/matlabcentral/fileexchange/4316-reverseplot), which has this feature, but a slightly inferior gui.

11 Oct 2010 Matthew

Awesome!

10 Nov 2010 Whitney

There are several versions of this type of GUI on the exchange, but this is by far the best one. It incorporates all of the stuff that the other guys are missing, plus the interface is very easy to use. I especially like that it can handle skewed images from really old scanned papers.

06 Dec 2010 Nassim Khaled  
17 Feb 2011 Thomas  
25 Mar 2011 quadro1327

very nice tool!

11 May 2011 Oscar

It is very helpful, veru well done

01 Jul 2011 mike

Thanks for the great tool. I'm currently trying to adapt it a little bit for my use, and bit of help would be appreciated.

I have a bunch of images from which I plan to grab data. However, they only have y axis reference points, so I can't calibrate them properly. The x-axis is on the same scale as the y-axis, so what I want to do is force the origins of both axes to be at the same location. Then I can force the horizontal distance (on screen) between Xo and Xmax to be the same as the vertical distance between Yo and Ymax. However, I don't really understand how the locations of the calibration points are stored and used, so I'm having trouble.

12 Jul 2011 James Herman  
22 Dec 2011 Ahmed Ali

Many thanks for you, you have solved a very complex problem for me

Please login to add a comment or rating.
Updates
21 Mar 2005

Added the functionality to start the GUI and open an image file from the command line.

Also embedded a sample image file to the function. Type 'GRABIT -sample'.

21 Mar 2005

Added the functionality to start the GUI and opening an image file from the command line.

Also embedded a sample image file into the fuction. Type 'grabit -sample'.

27 Dec 2005

Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox).

27 Dec 2005

Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox).

27 Dec 2005

Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox).

03 Mar 2006

Major code change. Added zoom feature during calibration. Added panning feature.

03 Mar 2006

Bug fix (typo)

13 Mar 2006

Animate view change and zooming for a better visual perception.

23 Mar 2006

Added mouse features: double-click to center view. right-click and drag to zoom. other minor code changes.

23 Mar 2006

Added mouse features: double-click to center view. right-click and drag to zoom. other minor code changes.

04 May 2006

Fixed loadImageFcn bug.

23 Jan 2007

Fixed bug. Now, grayscale images can be loaded.

Tag Activity for this File
Tag Applied By Date/Time
data exploration Jiro Doke 22 Oct 2008 07:43:31
data Jiro Doke 22 Oct 2008 07:43:31
extract Jiro Doke 22 Oct 2008 07:43:31
grab Jiro Doke 22 Oct 2008 07:43:31
image Jiro Doke 22 Oct 2008 07:43:31
data mining Jiro Doke 22 Oct 2008 07:43:31
scan Jiro Doke 22 Oct 2008 07:43:31
extract Jose Ercolino 20 May 2010 20:32:57
scan Jose Ercolino 20 May 2010 20:32:57
digitize Jose Ercolino 20 May 2010 20:32:57
this file is absolutely genious a great help also for diffucult Thomas 17 Feb 2011 05:21:08

Contact us at files@mathworks.com