accurately measuring rectangular shapes from microscope images

1 view (last 30 days)
I am trying to calibrate the magnification of my imaging system using a series of rectangular shapes of a specified size. I need to measure these imaged shapes in the images produced by my camera system. Does anyone know of any tools for fitting for doing this?
Here is an example image:

Answers (1)

Image Analyst
Image Analyst on 21 May 2018
Threshold the image
binaryImage = grayImage > someValue;
Then fill it, sum up the image, and divide by the number of rows.
[rows, columns, numberOfColorChannels] = size(grayImage);
binaryImage = imfill(binaryImage, 'holes');
numberOfWhitePixels = sum(binaryImage(:));
meanWidth = numberOfWhitePixels / rows
  2 Comments
Daniel
Daniel on 21 May 2018
Thank you for your answer. Unfortunately, there is some ambiguity in choosing the threshold value. The problem is the noise in the illuminated region. Is there any particular measures I might take to mitigate this problem?
Image Analyst
Image Analyst on 21 May 2018
Well who's to say what the "right" threshold is? You are. Just pick one visually and go with it. You can use my interactive/visual thresholding app https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc Or you can pick a level halfway between the bright edge and the dark part near it.

Sign in to comment.

Categories

Find more on Biomedical Imaging in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!