Clear Filters
Clear Filters

i want to read all images from the folder to compare the mask 632 images, which i created with the given 632 mask to find precision, recall and f-measure. this code works for two images to find precision, recall and f-measure.

1 view (last 30 days)
clear all;
clc;
close all;
im_GroundTruth = imread('Mask1.png'); % object=1; backgroud = 0;
im_GroundTruth(im_GroundTruth>0)=255;
im_segmentaion = im2uint8(imread('1(1).png')); % object=1; backgroud = 0;
Conf = confusionmat(im_GroundTruth(:),im_segmentaion(:));
recall = Conf(2,2)/sum(Conf(2,:))*100;
precision = Conf(2,2)/sum(Conf(:,2))*100;
f_measure = 2*recall*precision/(recall+precision);

Answers (0)

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!