bfscore.

图像分割的轮廓匹配分数

Description

例子

分数= bfscore(predictiongroundTruth的)计算预测分段之间的BF(边界F1)轮廓匹配分数predictionand the true segmentation ingroundTruthpredictionandgroundTruth可以是二进制分段的一对逻辑阵列,或者是多种多组分段的一对标签或分类阵列。

[分数precisionrecall] = bfscore(predictiongroundTruth的)also returns the precision and recall values for theprediction图像相比之下groundTruthimage.

[___] = bfscore(predictiongroundTruththreshold的)使用指定的阈值计算BF分数作为距离误差容差,以确定边界点是否具有匹配。

例子

全部收缩

读取具有对象到段的图像。将图像转换为灰度,并显示结果。

a = imread('hands1.jpg');I = rgb2gray(A); figure imshow(I) title('原始图像​​'的)

使用活动轮廓(Snakes)方法进行手动。

mask = false(size(I)); mask(25:end-25,25:end-25) = true; BW = activecontour(I, mask, 300);

Read the ground truth segmentation.

BW_groundTruth = imread('hands1-mask.png');

计算主动轮廓分割的BF分数对抗地面真理。

相似之处=bfscore.(BW, BW_groundTruth);

在彼此顶部显示面罩。颜色表示掩模的差异。

图imshowpair(bw,bw_groundtruth)标题(['bf得分='num2str(similarity)])

This example shows how to segment an image into multiple regions. The example then computes the BF score for each region.

读取具有若干区域的图像到段。

RGB = imread('yellowlily.jpg');

Create scribbles for three regions that distinguish their typical color characteristics. The first region classifies the yellow flower. The second region classifies the green stem and leaves. The last region classifies the brown dirt in two separate patches of the image. Regions are specified by a 4-element vector, whose elements indicate the x- and y-coordinate of the upper left corner of the ROI, the width of the ROI, and the height of the ROI.

region1 = [350 700 425 120];%[x y w h]格式BW1 = false(size(RGB,1),size(RGB,2)); BW1(region1(2):region1(2)+region1(4),region1(1):region1(1)+region1(3)) = true; region2 = [800 1124 120 230]; BW2 = false(size(RGB,1),size(RGB,2)); BW2(region2(2):region2(2)+region2(4),region2(1):region2(1)+region2(3)) = true; region3 = [20 1320 480 200; 1010 290 180 240]; BW3 = false(size(RGB,1),size(RGB,2)); BW3(region3(1,2):region3(1,2)+region3(1,4),region3(1,1):region3(1,1)+region3(1,3)) = true; BW3(region3(2,2):region3(2,2)+region3(2,4),region3(2,1):region3(2,1)+region3(2,3)) = true;

在图像顶部显示种子区域。

figure imshow(RGB) holdonvisboundaries(bw1,'Color''r');visboundaries(bw2,'Color''G');visboundaries(bw3,'Color''B');title('Seed regions'的)

Segment the image into three regions using geodesic distance-based color segmentation.

l = Imseggeodesic(RGB,BW1,BW2,BW3,'AdaptiveChannelweighting',真的);

加载图像的地面真相分割。

L_groundTruth = double(imread('YellowLily-segmented.png'));

用地面真理在视觉上比较分割结果。

图imshowpair(label2rgb(l),label2rgb(l_groundtruth),'剪辑'的)title('分割结果(左)和地面真理(右)的比较的)

计算每个分段区域的BF分数。

相似之处= bfscore(l,l_groundtruth)
相似之处=3.×10.7992 0.5333 0.7466

BF分数对于第二区域明显较小。该结果与分段结果的视觉比较一致,这错误地将图像的右下角的污垢分类为叶子。

输入参数

全部收缩

预测分割那specified as a 2-D or 3-D logical, numeric, orcategorical大批。如果prediction是一个数字数组,那么它表示标签数组,必须包含数据类型的非负整数双倍的

数据类型:逻辑|双倍的|categorical

地面真相分段,指定为2-D或3-D逻辑,数字或categoricalarray of the same size and data type asprediction。如果groundTruth是一个数字数组,那么它表示标签数组,必须包含数据类型的非负整数双倍的

数据类型:逻辑|双倍的|categorical

距离误差容忍阈值的像素,规范ified as a positive scalar. The threshold determines whether a boundary point has a match or not. Ifthresholdis not specified, then the default value is 0.75% of the length of the image diagonal.

Example:3.

数据类型:双倍的

输出参数

全部收缩

BF score, returned as a numeric scalar or vector with values in the range [0, 1]. A分数of 1 means that the contours of objects in the corresponding class inpredictionandgroundTruth是一个完美的匹配。如果输入阵列是:

  • 逻辑阵列,分数是标量,代表前景的BF分数。

  • 标签或分类阵列,分数是矢量。第一个系数分数是第一个前景类的BF分数,第二系数是第二个前景类的分数,等等。

精确那returned as a numeric scalar or numeric vector with values in the range [0, 1]. Each element indicates the precision of object contours in the corresponding foreground class.

精确is the ratio of the number of points on the boundary of the predicted segmentation that are close enough to the boundary of the ground truth segmentation to the length of the predicted boundary. In other words, precision is the fraction of detections that are true positives rather than false positives.

记起那returned as a numeric scalar or numeric vector with values in the range [0, 1]. Each element indicates the recall of object contours in the corresponding foreground class.

记起is the ratio of the number of points on the boundary of the ground truth segmentation that are close enough to the boundary of the predicted segmentation to the length of the ground truth boundary. In other words, recall is the fraction of true positives that are detected rather than missed.

更多关于

全部收缩

BF(边界F1)得分

BF评分测量对象的预测边界与地面真相边界匹配的接近。

The BF score is defined as the harmonic mean (F1-measure) of theprecisionandrecall具有距离误差容差的值来确定预测边界上的点是否在地面真实边界上具有匹配。

分数= 2 *precision*recall/(recall+precision的)

References

[1] Csurka,G.,D. Larlus和F. perronnin。“语义细分的良好评估措施是什么?”英国机器愿景会议的诉讼程序那2013, pp. 32.1-32.11.

也可以看看

|

介绍在R2017B.