Recognize centroids and radii of many circle
이전 댓글 표시

I have an image that contains many broken/slightly deformed circles because it is a cross section of an object. I need to be able to recognize the centroids and radii of them. I have attached the picture below. I have the image processing toolbox and have tried the method in the link below but it returns no radii or centroids. I have estimated the radius to be between 25 and 75. I also attached my code and picture I used.
img = imread('img.png'); %Reads image from directory
red = img(:,:,2); %Use first (red) color plane
red = adapthisteq(red); %Use adaptive histogram equalization
tic
[accum,circen,cirrad] = CircularHough_Grd(red,[15 75],20,13,1);
toc
if any(cirrad <= 0) %Eliminate zero radii
inds = find(cirrad>0);
cirrad = cirrad(inds);
circen = circen(inds,:);
end
imshow(red);
hold on;
plot(circen(:,1), circen(:,2), 'r+');
for ii = 1 : size(circen, 1)
rectangle('Position',[circen(ii,1) - cirrad(ii), circen(ii,2) - cirrad(ii), 2*cirrad(ii), 2*cirrad(ii)],...
'Curvature', [1,1], 'edgecolor', 'b', 'linewidth', 1.5);
end
hold off;
댓글 수: 1
Image Analyst
2013년 10월 4일
I don't see the img.png that you attached. Are you sure you attached it? Did you use the image icon or the paper clip icon?
답변 (2개)
Image Analyst
2013년 10월 4일
0 개 추천
I don't see your image. Can you use a method like in my Image Segmentation Tutorial : http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial-blobsdemo?
댓글 수: 11
Michael
2013년 10월 4일
Image Analyst
2013년 10월 4일
That image looks like it has bad chromatic aberration. Can you get a "blank shot" so that we can do some kind of background correction on it. Myabe you could try this: http://www.mathworks.com/matlabcentral/fileexchange/25619-image-segmentation-using-statistical-region-merging or this http://www.mathworks.com/products/demos/image/color_seg_k/ipexhistology.html
Michael
2013년 10월 11일
Michael
2013년 10월 11일
Image Analyst
2013년 10월 11일
Yes that looks sharper, I think. It looked like in your original image there was shear between the red, green, and blue color channels so that the centroids might not be in the same place for each color channel. If these centroids are okay, you can look at my BlobsDemo app which does that: http://www.mathworks.com/matlabcentral/answers/contributors/1343420-image-analyst/answers You might have to separate any touching blobs using something like watershed: http://blogs.mathworks.com/steve/2006/06/02/cell-segmentation/
Michael
2013년 10월 11일
Image Analyst
2013년 10월 11일
Attach the image as a file (use the paper clip icon). If I get time (I'm traveling in South America at the moment), I'll see what I can do. I think that it should work though if you just adjust some parameters.
Michael
2013년 10월 22일
Image Analyst
2013년 10월 22일
If a blob is not a perfect circle, you can get the "diameter" by asking regionprops() for "EquivDiameter" which is the diameter you'd get if you molded your blob into a perfect circle with the same number of pixels.
Michael
2013년 10월 23일
Image Analyst
2013년 10월 23일
No - I just haven't had time, and I'm about to leave town again in a few hours for a few days so I may not get to it soon, if ever. Sorry.
카테고리
도움말 센터 및 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!


