Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect different kinds of circles and ovals on the image using OpenCV and Python

I need to detect the different shapes on the image such as ellipses and circles with a dashed-border.

Using OpenCV causes some troubles, for e.g. openCV detects not a contour but an amount of small separated lines(contours). In case of ellipse with a "dashed-border" I need it to be as single contour, not a separated objects.

What would you suggest to solve this problem?

I also need to recognize the ellipses(or circles) with solid border and ellipses(circles) with a dashed-border

Ellipse with solid border

enter image description here

Ellipse with dashed border:

enter image description here

like image 288
Leonid Shusharin Avatar asked May 25 '15 12:05

Leonid Shusharin


1 Answers

The Hough transform should not have any troubles with either dashed or solid borders, or a mix thereof. I have used it to detect dashed lines in one of my project and ellipses should not be much harder.

OpenCV by default only implements the Hough transform for circles and straight lines but there is a blog entry with code on how to adapt it for elliptical shapes.

like image 67
Sebastian Wozny Avatar answered Sep 17 '22 01:09

Sebastian Wozny