user30985 user30985 - 1 year ago 451
Python Question

What is the difference between imregionalmax() of matlab and scipy.ndimage.filters.maximum_filter

I need to find the regional maxima of an image to obtain foreground markers for watershed segmentation. I see in matlab use the function

. As I don't have the matlab software, I use the function
instead. However, the results from
are different.

Please help me how to find out the regional maxima of an image. Thanks very much for your help.

Answer Source

It appears as if scipy's maximum_filter returns the actual local max values, while Matlab's imregionalmax returns a mask with the locations of the local maxima.
I would expect

 lm = scipy.ndimage.filters.maximum_filter( img, ... )
 msk = (img == lm) #// convert local max values to binary mask

should give you similar results to Matlab's.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download