image processing area calculation
显示 更早的评论
Hi,
I am new to image processing in matlab and I am trying to get an area measurement out of histology slides. I want to convert the image to binary get a pixel count of the white area and using a known distance (scale bar) in the image calculate the area.

I am using a sample code for medical image processing webinar but I am having trouble getting the right amount of contrast in my images I am not getting them to completely convert to a binary image.
Is there a way for me to first close out the edges that are not complete in the image and fill and then convert to binary or another method that would work?
function [image] = getCA(image)
A = imread (image);
glayer = A(:,:,2);
figure;
imshow(glayer)
agray = rgb2gray (A);
level = graythresh (agray);
abinary = ~im2bw(glayer, level);
figure;
imshow(abinary)
cc = bwconncomp (abinary);
stats = regionprops (cc, 'basic');
B = [stats.Area];
[~,biggest] = max(B);
abinary(labelmatrix(cc)~=biggest) = 0;
imshow(abinary)
abinary = imfill(abinary, 'holes');
Thanks so much for the help!
回答(2 个)
Image Analyst
2014-7-18
0 个投票
image is the name of a built in function. Do not use it as the name of a variable.
I'm not sure what you're calling "white" in the image, and what region(s) you'd like the area of.
I don't see any code there where you are trying to extract the 300 um scale bar.
See my Image Segmentation Tutorial for how to threshold and get areas: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
linson vincent
2018-1-26
0 个投票
how to find area of a image using matlab
1 个评论
Image Analyst
2018-1-26
Multiply the number of pixels in the image by the spatial calibration factor in real world units per pixel. See attached spatial calibration demo.
类别
在 帮助中心 和 File Exchange 中查找有关 Region and Image Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!