MATLAB: Dice similarity index between segmented image and ground truth

Image Processing Toolboxsimilarity index

Helo I have an segmented image , trying to find dice similarity index between the segmented image and ground truth.

Best Answer

How about this:
dice = 2*nnz(segIm&grndTruth)/(nnz(segIm) + nnz(grndTruth))
This expects segIm and grndTruth to be of the same size. They must also be numeric or logical.
Related Question