View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Image Measurement Utility

4.8 | 28 ratings Rate this file 91 Downloads (last 30 days) File Size: 2.41 MB File ID: #25964 Version: 1.9
image thumbnail

Image Measurement Utility



27 Nov 2009 (Updated )

Interactive tool allowing the measurement of distances, radii, and angles in images

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

This tool is intended to aid measuring on images. In order to do this the image needs to have some visual scale to calibrate the pixel to length ratio on, e.g. scale bar, ruler.
It can measure:
- the distance between points
- the perpendicular distance between a line and a point
- the length of a spline
- the radius of a circle
- the angle of the intersection of two lines
All measurements can be deleted or modified afterwards.

The tool is intended for high quality measurements, and is therefore build around tools like "imline" from the image processing toolbox. These tools are powerful because they allow you to select, zoom, re-adjust, and than confirm your selection. Nevertheless, a "quick" selection option is added to allow measurements with less mouse clicks (also useful for users whom don't have the IP toolbox).

The tool can handle batches of images, allowing measurements on several images with only one calibration. This also allows for measurements where a different image was used to calibrate the scale on.

The results can be saved to the workspace and to a text file (which can be read in excel as a .csv). Additionally two image save options are provided, i.e. PNG and PDF, where the PNG version also anti-aliases the image.

Finally, help is provided in the form of a status bar guiding the user through the process, complemented with readable tooltips and a full help readme, accessible from the interface.


This file inspired Microscopy Image Browser (Mib).

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (42)
05 Feb 2017 Ayman Saleh

For some reason, whenever I try to upload an image, I keep getting these errors.
Error using dir
Characters adjacent to a ** wildcard must be file separators.

Error in measuretool>FileBrowse_Callback (line 174)
filestmp = dir([filepath filesep '*' imagetypes{i}]);

Error in gui_mainfcn (line 95)

Error in measuretool (line 41)
gui_mainfcn(gui_State, varargin{:});

Error in>@(hObject,eventdata)measuretool('FileBrowse_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating UIControl Callback
Anyone have any idea what I am doing wrong?

Comment only
11 Oct 2016 SL

SL (view profile)

It would be really great to get the syntax `measuretool(Img)` such that you do not need to use the file browser to find the file. I would also like to get better documentation with clear synapse and example commands in Matlab promp.

23 May 2016 Nikolay

17 Mar 2016 Kealie Goodwin

This is extremely useful. Only reason for 4/5 stars is that it re-plots the image and measurements every time and if you have a lot of measurements (100+), it can bog down a get a little slow.

17 Mar 2016 Kealie Goodwin

This is a wonderful tool and very useful for my application. Is there a way to preserve a zoomed in view, rather than zooming out after each measurement? I'd like to stay zoomed in as I am making many measurements in a small area.

Comment only

App is not opening perfectly in matlab 2014a. top portions of app is not visible. I cannot load files.

Comment only
15 Aug 2015 William Currier

Great tool! It has been incredibly helpful for me and very easy to use. It is very accurate and makes measuring a large number of images in a dynamic environment very easy.

I was wondering if it is possible to have something that stores the calibration coordinates to the workspace similar to how the software stores the distance measurements.

So I am thinking there could be a structure that includes the following fields in the first row:

filename = 'name of image'
type = 'calibration'
value = 'distance between the two points'
intensity = '--'
profile = '--'
unit = 'calibration units'
x and y = 'the x or y coordinate for the calibration'

Also, another thing that I have noticed is that if one is measuring a large number of images and re-calibrates halfway through it changes all of the previous measurement values based on this re-calibration. It would be great in my opinion if this was more explicit or optional.

22 Apr 2015 Nguyen Thanh Dong

Thank you very much for this SOFTWARE.
I want to measure size of objects from capturing an image on a microscopy and this software has made my work complete.

Comment only
22 Apr 2015 Jan Klement

Excelenet for 2D measurements.

17 Apr 2015 Amit Saha

Thank you very much for this great tool. This tool has made my project complete, on machine vision systems. Thank you, thank you so much.

Comment only
26 Mar 2015 Ilya Belevich

Hi Jan,
thank you for this great work!

I've noticed a small bug: when I delete a measurement the n-numbers of the others are not changed. As result addition of a new measurement produces two measurements with the same n-number.

10 Nov 2014 Aditya

Aditya (view profile)

Really awesome stuff - great interface, great use of cross-hairs for identifying features.

An enhancement idea:
If I have engineering data traces, it would be great to do calibration in 2 directions and then automatically calculate coordinates of points from the origin.

12 Sep 2014 Dushyant

03 Sep 2014 Andrew Lingenfelter

Great App. Just wanted to say thanks!

10 Apr 2014 jan

I would suggest an application for google glass of this tools.

Comment only
10 Apr 2014 Lacey

Lacey (view profile)

Hi Jan-

Great tool! I noticed the measurement displays with only two decimal places. Can you build in an option that allows you to select how many significant digits you wish to display the measurement? Also, is it possible to make an option to display the x and y coordinates of the distance as well?

Thanks for posting this app. It is very helpful!

09 Apr 2014 Jan Neggers

Thank you Jie, you are correct, I forgot to add .bmp to the list of options, and your fix is perfect. I will update the tool accordingly.

Comment only
08 Apr 2014 Jie

Jie (view profile)

I think this is a great tool.
But I have a doubt. Does this toolbox work for .bmp file? When I try to browse .bmp files, there seems to be error. Pictures I took in microscope is usually .bmp file.
I simply add "*.bmp"(in correct form) in your .m file No. 156 & 160 line. It seems work good. Do you think I'm doing right? Wish to hear from you.

04 Feb 2014 Justin Blaber

Thanks for the great tool!

08 Jan 2014 Matt

Matt (view profile)

Great tool, easy to use and works well. The ability to turn off image processing tool box requirement is a very nice touch

18 Jun 2013 Justin

Justin (view profile)

I haven't used this much yet, but it looks great. Is there any simple way to reduce the height of the GUI so that it doesn't extend below my task bar though?

Comment only
30 Apr 2013 Mario

Mario (view profile)

It is very simple and its use is intuitive. I love it and use it all the time.

25 Apr 2013 Ahmed

Ahmed (view profile)

24 Apr 2013 Marcelo Soto Thompson

07 Apr 2013 ganzong

This is really a good work. Well done.

27 Mar 2013 Moatasem chehaiber

Great job

09 Feb 2013 Vijay

Vijay (view profile)

How to get the real length & breadth of an image in millimeters?
i need it to calculate pixels/mm for my text extraction project

13 Jan 2013 Shahab

Shahab (view profile)

great program, thanks

18 Jun 2012 Sabad

Sabad (view profile)

Amazing tool!
So useful. Thanks a lot.

20 May 2012 Civil Eng

I am getting errors whatever I click

Comment only
20 May 2012 Civil Eng

29 Mar 2012 Selcuk Fidan

10 Jan 2012 ling li


10 Jan 2012 Jan Neggers

Hi Jakub, i'll see what I can do, this is a little bit more complex as one might think since the intensity is stored in pixels which are discrete by nature, and the measurement lines do not follow pixel locations per se, so some interpolation is required.

Comment only
28 Dec 2011 Jakub

Jakub (view profile)

Hi Jan,

Great tool. Would it be possible to add a feature to measure mean intensity of signal within line length.


Comment only
09 Oct 2011 GANESH Prabhakar

superb tool ..Thank u

11 Mar 2011 Jan Neggers


If you don't have the function imline, then you probably have a matlab version older then 2009b, or maybe the function is provided by the image processing toolbox.

Comment only
10 Mar 2011 Becky

Becky (view profile)

I am getting an error when I try to calibrate (see below). Can you offer any suggestions? I have an jpeg radiographic image.

??? Undefined function or method 'imline' for input arguments of type 'double'.

Error in ==> measuretool>Calibrate_Callback at 435
h = imline(Data.gca,[u(1) v(1) ; u(2) v(2)]);

Error in ==> gui_mainfcn at 96

Error in ==> measuretool at 41
gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)measuretool('Calibrate_Callback',hObject,eventdata,guidata(hObject))

??? Error while evaluating uicontrol Callback

Comment only
01 Sep 2010 Jason Tolentino

great program in analyzing TEM images. I wanted to know how difficult is it to save the data because I would like to do size distribution analysis on the saved data.

02 Apr 2010 Till

Till (view profile)

Hi Jan,
thanks for this nice tool. However, I have a question: I have gray scale TEM images in tif format. Your tool seems to convert them to RGB. I had a very short glance at the code, and think it is related to the call of imagesc in line 324. It might also be related to the specific format of my tif file. It would be nice, if you could comment on this.

27 Jan 2010 Prashanth Ravindran

this GUI is excellent. It can measure the distance between 2 points, perpendicular distance of a point from a line, angle between 2 lines. This GUI is fantastic.

01 Dec 2009 Jan Neggers

I've posted an update to fix some minor bugs, awaiting review at the moment.

Comment only
01 Dec 2009 1.1

Fixed some minor bugs, that would throw errors to the command screen when pressing buttons in an unexpected order.

06 Apr 2010 1.2

I've fixed the color issue, mentioned by Till, also added a lot of comments to make the code more readable, and changed the method of providing the in GUI help.

23 Sep 2011 1.3

Added the long awaited save options, and fixed a bug with the help function not working.

28 Sep 2011 1.4

A major update of the GUI, the interface is more intuitive now, also, some options have been added to allow the use of this tool for pre 2009b versions of matlab or in absense of the IP toolbox.

07 Dec 2011 1.6

Made the GUI more intuative by improving the status texts, and disabling most buttons during a measurement.

10 Jan 2012 1.7

Added a feature, as suggested by Jakub, now the average intensity can be drawn, and the intensity profiles can be saved to the workspace.

12 Sep 2012 1.8

Updated to include an App file for R2012b

09 Apr 2014 1.9

added the .bmp image type as suggested by Jie

Contact us