Ask Your Question

Regional maxima from python

asked 2013-03-13 05:26:37 -0500

jeanpat gravatar image

Hello, Is it possible to compute the regional maxima of a grey scaled image (8bits or more) ?

thank you


(opencv 244 build from source, python 2.7)

edit retag flag offensive close merge delete


there's minMaxLoc, but that's global (for the whole img or roi you apply it on)

what do you mean by 'regional' ?

berak gravatar imageberak ( 2013-03-13 05:43:51 -0500 )edit

There a definition in Castleman, K :

If you think of an image as a landscape, regional maxima yields the local tops. This not the max value of the image. I have browsing again the documentation but that morphological operator doesn't seem to be implemented.

jeanpat gravatar imagejeanpat ( 2013-03-13 07:10:05 -0500 )edit

thanks for clarifying.

and i'd think so, too - no such thing in the library

berak gravatar imageberak ( 2013-03-13 07:31:59 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-03-13 12:09:20 -0500

awknaust gravatar image

You'd have to do it by hand. You make a 2D filter which you slide across the image so that each pixel becomes 0 if it is not the maximum in the neighborhood and retains its value otherwise.

edit flag offensive delete link more


Sounds like a kind of non-maxima suppression.

Guanta gravatar imageGuanta ( 2013-03-13 12:28:58 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-03-13 05:26:37 -0500

Seen: 928 times

Last updated: Mar 13 '13