使用matlab regionprops计算区域的平均强度

Calculating average intensity of area with matlab regionprops

我有一张灰度图,上面有一些形状不同的物体。 我也有这张灰度图片的二进制图像。

使用 MajorAxesLength 和 MinorAxisLength 比率(来自 regionprops)我可以识别它们中的每一个,但是我如何计算每个物体的平均强度?

是否可以计算线的平均强度,给出 MinorAxisLength 和 MajorAxisLength?

添加到 regionprops 'PixelIdxList' 句柄。然后您可以执行以下操作:

s = regionprops(BW,'PixelIdxList');
for n=1:numel(s)
     meanI(n)=mean(image(s(n).PixelIdxList));
end

假设BW是二值图像,image是灰度图像。