'How to calculate the similarity between the label and the ground truth of an image segmented using thresholding?
In Matlab, I use multithresh to segment the MRI image into 6 regions. After my observation, I found that the segmented regions were roughly the same as the ground truth, but their corresponding labels were very different compared to the ground truth, for example, my label is [0 0 0 1 1 1 2 2 2], ground truth's label is [2 2 2 1 1 1 0 0 0], so I got very poor results when I used dice to calculate the similarity. Is there a good way to fix this problem.
thresh = multithresh(grayimg, 5);
seg_img = imquantize(grayimg, thresh);
% This is because the label range obtained by multithresh is [1, 6], but the real label
% range is [0, 5].
seg_img = seg_img - 1;
ground_truth = double(label(:,:,1));
similarity = dice(seg_img, ground_truth)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
