Dice similarity score for image segmentation.

3 views (last 30 days)
begginer01
begginer01 on 28 Mar 2019
Edited: begginer01 on 28 Mar 2019
Hi.. I want to evaluate Dice similarity score for image segmentation. But when ever I run my code I got blank image. I want to pair both images i.e segmented image and grounth truth image. But only dice score appeared on screen but no paired image appears.. Why so? Plz help.
Plz look out this code. I am also attaching figure. Plz help me out
b=imread('C:\Users\User\Desktop\new7\135_3_kmeans.jpg');
b1=imresize(b,[128 128],'nearest');
imshow(b1)
ab=logical(b1(:));
BW_groundTruth =(imread('C:\Users\User\Desktop\gt_2.jpg'));
gt=imresize(BW_groundTruth,[128 128],'nearest');
imshow(gt)
c=logical(gt(:));
similarity = dice(ab, c);
figure
%imshowpair(label2rgb(ab),label2rgb(c),'montage')
imshowpair(ab,c)
title(['Dice Index = ' num2str(similarity)])

Answers (0)

Categories

Find more on Agriculture 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!