如何计算同质性?

时间:2018-06-07 08:45:51

标签: image matlab image-processing

我试图在matlab中找到一个图像是同质的。我的图像包含5个硬币。我使用函数improfile来创建强度,但我不知道如何识别均匀圆。 使用硬币内部的强度考虑均匀性。 如何编码

close all;clear all;
I = imread('coins.png');
bw =( im2bw(I, graythresh(I)));
[L N]= bwlabel(bw);
ele=find(L==3);
Im1=zeros([size(I,1) size(I,2)]);
Im1(ele)=1;
figure,imshow(Im1)
ML=I; ML(Im1==0)= 0; figure, imshow(ML);
figure,imhist(ML(Im1==1))
st = regionprops(L,I,'PixelValues'); 
pv = st(3).PixelValues;
figure, imhist(pv)

我绘制直方图。但我不知道如何继续

直方图和正常直方图的标准偏差绘制相同 enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

您可以从灰度直方图或梯度强度直方图中绘制同质性标准。

低色散(小方差)显示出准恒定的亮度,但对平滑变化很敏感。

低梯度平均值显示缺乏细节,但对纹理/噪音敏感。