accurately measuring rectangular shapes from microscope images
1 view (last 30 days)
Show older comments
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:
0 Comments
Answers (1)
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
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.
See Also
Categories
Find more on Biomedical Imaging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!