I do not get why a segmentation obtained by using multithresh
on an "original" double image is different from a segmentation using the same parameters on the same image scaled by mat2gray
.
E.g.:
testimage = randi(100,[200 200]);
figure;imagesc(testimage)
threshs = multithresh(testimage,5);
l0 = imquantize(testimage,threshs);
threshs = multithresh(mat2gray(testimage),5);
l1 = imquantize(mat2gray(testimage),threshs);
Here, in my case l1
is different from l0
in 808 pixels. Why? The relative differences between pixels in testimage
and mat2gray(testimage)
should be equivalent, just the absolute differences change. How is this important to multithresh?