views:

61

answers:

1

How do I threshold an image to find the local maxes in a robust way? I know I can just look at the data, visually guess at some appropriate h value, and do imextendedmax(I,h) where h is the threshold... but I'm looking for a more robust way to do it in Matlab. I'm pretty new to Matlab and coding so this is all foreign...

Update

No, I'd still need to do thresholding because of a noisy background (still somewhat noisy even after I filter it). imregionalmax() would give way more local maxes therefore than I need.

A: 

Generate a histogram, find the max valued bin, then set your threshold at some fixed offset below this.

Or for a slightly more sophisticated approach, sum the histogram bin counts starting at the max value and work downwards until you have accumulated some fixed percentage of the total population, e.g. 0.1%, and set your threshold there.

Paul R