Dice similarity score for image segmentation.

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)

Asked:

on 28 Mar 2019

Edited:

on 28 Mar 2019

Community Treasure Hunt

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

Start Hunting!