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.
Michael
2013 年 10 月 12 日
カテゴリ
ヘルプ センター および 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!


