Convert to monochromatic & Recognize centroid and radii
2 次查看(过去 30 天)
显示 更早的评论
I have a color image that I want to convert to monochromatic. Also he image contains many broken/slightly deformed circles because it is a cross section of an object. I need to be able to recognize the centroid sand radii of them. I have attached the picture below.
Note: I don't have the image processing toolbox. If it isn't possible to convert to monochrome that isn't a huge deal

0 个评论
回答(1 个)
Youssef Khmou
2013-10-1
编辑:Youssef Khmou
2013-10-1
Micheal, The only contribution i can offer is like this : i think the centroid function is in the Image processing ToolBox, but you can proceed as the following :
Suppose your Image I is RGB ( or HSV) you convert it to grayscale :
X=(0.2989*I(:,:,1)+0.5870 *I(:,:,2)+0.1140*I(:,:,3));
You make a binary sample by choosing a certain threshold, lets say the mean of the whole sample :
thresh=mean(X(:));
[m n]=size(X);
B=zeros(m,n);
for x=1:m
for y=1:n
if X(x,y)>thresh
G(x,y)=1;
end
end
end
Next you choose a tiny portion, let say a elementary particle from your sample ( in the medium as example ):
S=G(floor(end/2):10+floor(end/2),floor(end/2):10+floor(end/2));
You try next to count the white pixels, and try to use some geometrical relation to deduce the Radius,
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!