matlab - 当我尝试计算图像分割结果的准确性时,为什么我得到 0 作为输出?

标签 matlab image-processing ocr image-segmentation

我使用bboxPrecisionRecall检查了分割方法的准确性。 Matlab 版本“9.4.0.857798 (R2018a) Update 2”中的函数并使用 IESK-ArDB 测试算法的结果数据集。该数据库免费提供here 。数据库图像样本herehere 。当尝试计算准确性时,我得到 0 作为输出。我应该怎样做才能获得分段算法的真实结果?

代码如下:

%% clean Workspace
clear;
clc;
%% my segmented bounding box cell
propied = {[48.5,84.5,102,59];[169.5,71.5,96,77];[251.5,114.5,47,51]}
%% Read Image
im = imread('t_A01_010.bmp');
imshow(im)
hold on
%% Ground truth standerd boxes.
%[GTruth,txt,raw] = xlsread('demo.xlsx');
groundTruthBoxes = [235 102 301 170;164 66 267 153 ;43 80 153 148]
%Convert bounding boxes from struct to cell.
boundingBoxes = propied;

% Convert cell to Matrix
bb = cell2mat(boundingBoxes(:));
% Move rows up down and fix matrix numbers
bb1 = fix(flipud(bb))
% Draw rectangle boxes for segmented Algorithm
for i=1:3
    rectangle('Position',bb1(i,:),'EdgeColor','y');
end
% Draw rectangle boxes for Standerd Ground Truth
for i=1:3
    rectangle('Position',groundTruthBoxes(i,:),'EdgeColor','g');
end    
%Evaluate the overlap accuracy against the ground truth data.
[precision,recall] = bboxPrecisionRecall(bb1,groundTruthBoxes)

segmented image Result on Command window

最佳答案

因为检测率treshold

函数的第三个输入(默认 0.5)指定 2 个框之间的最小重叠,以将它们视为“匹配”。你的盒子的大小如此不同,以至于该方法假设它们根本不匹配,即看的不是同一件事。您可以更改此值以改变输出。

例如:

[precision,recall] = bboxPrecisionRecall(bb1,groundTruthBoxes,0)
precision =

     1


recall =

     1

[precision,recall] = bboxPrecisionRecall(bb1,groundTruthBoxes,0.1)
precision =

    0.6667


recall =

    0.6667

关于matlab - 当我尝试计算图像分割结果的准确性时,为什么我得到 0 作为输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56935911/

相关文章:

matlab - MATLAB 中的 @ 运算符(at 符号)是什么?

python - 使用 Python 在非常大的图像中进行高性能变量模糊

image-processing - Hadoop 将图像分割成小块以进行分割过程

windows-runtime - 使用 OCR 引擎识别 Micr 字体?

matlab - MATLAB 中的隐马尔可夫模型

matlab - 从灰度图像的 2D 切片集创建 3D 体积

ocr - 如何在tesseract OCR中安装语言

c++ - 提高 Tesseract 检测质量

matlab - 如何在 MATLAB 中控制双矩阵的显示?

python - 在自定义数据上训练 EAST 文本检测器