Effect of mat2gray on multithresh
<p>I do not get why a segmentation obtained by using <code>multithresh</code> on an "original" double image is different from a segmentation using the same parameters on the same image scaled by <code>mat2gray</code>.</p>

<p>E.g.:</p>

<pre><code>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);
</code></pre>

<p>Here, in my case <code>l1</code> is different from <code>l0</code> in 808 pixels. Why? The relative differences between pixels in <code>testimage</code> and <code>mat2gray(testimage)</code> should be equivalent, just the absolute differences change. How is this important to multithresh?</p>