Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

break up contours found by findContours

Good Evening,

I'm trying to use OpenCV to detect remote controlled robots in an arena. These robots typically contrast well with the surroundings so my approach has been to use the Canny detector to find edges and then use findContours to filter out contours I don't care about. (Please refer to linked image) For example in the top left image I don't care about the long straight lines that are caused by the edge of the arena. In general I can discard these by aspect ratio. However in some cases (bottom left) findContours keeps multiple lines in one contour and then fills in a box (grey in bottom right)

My question is, is there a way to break up these lines output from findContours ?

I have played with thresholds on the Canny detctor and while higher quality does tend to break up those lines it also loses track on those robots (which apparently are not high quality features! :) )

Apparently my karma is neither high enough to post links nor attach images. please go to

imgur dot com/a/9GwOo

to see the accompanying image

I'm working in Python but also grok C++. Any help or direction appreciated. Thank you,

philip

break up contours found by findContours

Good Evening,

I'm trying to use OpenCV to detect remote controlled robots in an arena. These robots typically contrast well with the surroundings so my approach has been to use the Canny detector to find edges and then use findContours to filter out contours I don't care about. (Please refer to linked image) For example in the top left image I don't care about the long straight lines that are caused by the edge of the arena. In general I can discard these by aspect ratio. However in some cases (bottom left) findContours keeps multiple lines in one contour and then fills in a box (grey in bottom right)

My question is, is there a way to break up these lines output from findContours ?

I have played with thresholds on the Canny detctor and while higher quality does tend to break up those lines it also loses track on those robots (which apparently are not high quality features! :) )

Apparently my karma is neither high enough to post links nor attach images. please go to

imgur dot com/a/9GwOo

to see the accompanying imageimage description

I'm working in Python but also grok C++. Any help or direction appreciated. Thank you,

philip

break up contours found by findContours

Good Evening,

I'm trying to use OpenCV to detect remote controlled robots in an arena. These robots typically contrast well with the surroundings so my approach has been to use the Canny detector to find edges and then use findContours to filter out contours I don't care about. (Please refer to linked image) For example in the top left image I don't care about the long straight lines that are caused by the edge of the arena. In general I can discard these by aspect ratio. However in some cases (bottom left) findContours keeps multiple lines in one contour and then fills in a box (grey in bottom right)

My question is, is there a way to break up these lines output from findContours ?

I have played with thresholds on the Canny detctor and while higher quality does tend to break up those lines it also loses track on those robots (which apparently are not high quality features! :) )

image description

I'm working in Python but also grok C++. Any help or direction appreciated. Thank you,I tried feeding my Canny image into HoughLinesP to remove lines. After some tweaking the situation is improved (see figure) now I just have small triangles instead of large quadrilateral.

image description

I am still looking for a solution to break up lines remaining in the canny image.

thanks

philip