Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to find whether the position is a Peak position in a kernel window?

I am searching for an OpenCV function that replicates the function of peak_local_max in scikit-image. What this function does is, It compares the values over a window of mentioned size whether the anchor point value is greater than or equal to the maximum of other positions or not. If the case satisfies, it considers it as a local peak.

Is there a OpenCV function that could do this job? I know about minmaxLoc and minmaxIdx but it calculates for global frame which I am not interested. I am thinking of taking the filter2D function as reference and create my own functionality to do this. On the parallel side I want your suggestions to go about this problem?

Any help could be really appreciated. Thanks in advance!

How to find whether the position is a Peak position in a kernel window?

I am searching for an OpenCV function that replicates the function of peak_local_max in scikit-image. What this function does is, It compares the values over a window of mentioned size whether the anchor point value is greater than or equal to the maximum of other positions or not. If the case satisfies, it considers it as a local peak.

Example of what I want,

image description

Consider my image is 5x5 and I want to find the local peaks in the window size of 3x3. If you could apply the criteria I explained in the question(It compares the values over a window of mentioned size whether the anchor point value is greater than or equal to the maximum of other positions or not), only one value satisfies 10.79. But in the case of minmaxloc it will find first 10.79 later after the mask is updated it will give 10.6 but 10.6 is definitely not the local peak and we wont know when to stop.

Is there a OpenCV function that could do this job? I know about minmaxLoc and minmaxIdx but it calculates for global frame which I am not interested. I am thinking of taking the filter2D function as reference and create my own functionality to do this. On the parallel side I want your suggestions to go about this problem?

Any help could be really appreciated. Thanks in advance!