Ask Your Question
0

How do I write a python code for non maxima suppression?

asked 2017-09-19 02:04:29 -0600

Santhosh1 gravatar image

updated 2017-09-19 02:05:16 -0600

I am implementing this algorithm, which requires Non Maxima Suppression (NMS) as one of its steps.

I found this (Faster) Non-Maximum Suppression in Python

and

This Efficient Non-Maximum Suppression

I am finding it hard to understand, confused how to write the code.

Can anyone explain what exactly happens here?

I want to write my own code for this

I am writing my code in python, not C++.

edit retag flag offensive close merge delete

Comments

1

If you want to write your own code for NMS, then this forum is not what you need, but a general Python forum will be ... this is a forum focussed on OpenCV, which already provides NMS. Also the pyimagesearch has the complete code available?

StevenPuttemans gravatar imageStevenPuttemans ( 2017-09-19 06:20:26 -0600 )edit

@StevenPuttemans How can OpenCV help me in this case where I have to thin the edges? NMS is being used in bounding box for object detection, not for thinning the edges in pyimagesearch

Santhosh1 gravatar imageSanthosh1 ( 2017-09-19 08:20:31 -0600 )edit

@StevenPuttemans Please don't say erosion

Santhosh1 gravatar imageSanthosh1 ( 2017-09-19 08:22:09 -0600 )edit

Hmmm how about thinning algorithms?

StevenPuttemans gravatar imageStevenPuttemans ( 2017-09-19 08:28:40 -0600 )edit
1

@StevenPuttemans I did find thinning algorithm from here and tried to implement Zhang-Suen algorithm and Guo-Hall algorithm These don't seem to work well for images with a lot of noise.

Got a solution for this when I contacted one of the authors who implemented the algorithm.

I'll post solution as soon as I am allowed to answer my own question here ๐Ÿ˜

Santhosh1 gravatar imageSanthosh1 ( 2017-09-20 05:58:06 -0600 )edit

@StevenPuttemans: I have been searching for an OpenCV python function for NMS but have just not been able to find it.

Will you be kind enough to point me to the OpenCV function please?

RS

RS_CU gravatar imageRS_CU ( 2019-01-14 02:14:01 -0600 )edit

You can find one for bounding boxes right here: https://github.com/opencv/opencv/blob...

StevenPuttemans gravatar imageStevenPuttemans ( 2019-01-16 04:01:14 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-09-22 00:15:16 -0600

Santhosh1 gravatar image

This is the python code I found online for Non Maxima Suppression. This is actually being used for finding Canny edge. Which is actually what is required for this article.

Hope it helps someone :)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-09-19 02:04:29 -0600

Seen: 18,724 times

Last updated: Sep 22 '17