O(1) peak segmentation algorithm in matlab?
I'm not sure why you need to call imreconstruct more than once. The way you normally use morphological reconstruction is described here: You basically subtract some constant (the peak threshold) from your source image, then reconstruct it. What you get is an image that is identical to your original image except at the peaks:



So you simply take the difference and binarize, or compare the two images pixel-wise.