Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

(Best) way to track a circle with a cross inside

Hi,

I am currently trying to find a solution on how to track a specific target which looks like this:

target

It is just a circle with a cross inside.

I am using opencv 2.4.8 in ROS Indigo on Ubuntu 14.04 Currently I am at this point:

  • apply Canny-Edge-detection on the frames
  • find and draw contours (drawing mostly for debugging purposes)
  • for each contour calculate the eccentricity like this:

formula

I wanted to use the eccentricity to filter out most of the fitted ellipses which are very narrow and are not even close to a circle. But I can not calculate moments from the ellipses, but only from the contours. And I have no idea if this comes even close to what I want to achieve.

Is there another possibility to calculate the eccentricity or the roundness of the fitted ellipses? I think the I tried googling it and this was the most promising approach.

Am I at least on a right way to get this working anytime? Or is there another approach which would work better and/or more stable. I need a robust tracking algorithm which also works in non-perfect lightning conditions and also works if the circle is no perfect circle anymore in the picture (because the camera is not always perfectly perpendicular to the circle)

I already sorted out the following methods, which all do not work for some reasons

  • Shape-Matching
  • Template-Matching
  • Hough Circle Transform (at most perfect circles are detected)

If there are more information I should provide or something I should clarify, please feel free to ask. Sorry if this post should be a little messy, I hope you got me anyway.

(Best) way to track a circle with a cross inside

Hi,

I am currently trying to find a solution on how to track a specific target which looks like this:

target

It is just a circle with a cross inside.

I am using opencv 2.4.8 in ROS Indigo on Ubuntu 14.04 Currently I am at this point:

  • apply Canny-Edge-detection on the frames
  • find and draw contours (drawing mostly for debugging purposes)
  • for each contour calculate the eccentricity like this:

formula

I wanted to use the eccentricity to filter out most of the fitted ellipses which are very narrow and are not even close to a circle. But I can not calculate moments from the ellipses, but only from the contours. And I have no idea if this comes even close to what I want to achieve.

Is there another possibility to calculate the eccentricity or the roundness of the fitted ellipses? I think the I tried googling it and this was the most promising approach.

Am I at least on a right way to get this working anytime? Or is there another approach which would work better and/or more stable. I need a robust tracking algorithm which also works in non-perfect lightning conditions and also works if the circle is no perfect circle anymore in the picture (because the camera is not always perfectly perpendicular to the circle)

I already sorted out the following methods, which all do not work for some reasons

  • Shape-Matching
  • Template-Matching
  • Hough Circle Transform (at most perfect circles are detected)

If there are more information I should provide or something I should clarify, please feel free to ask. Sorry if this post should be a little messy, I hope you got me anyway. anyway.

EDIT: Here is an image from my webcam: output

On the left side, there is just the input image after Canny-Edge-detection. In the right picture you can see the original input with contours (green) and some fitted ellipses (blue). At first I want to filter out these very stretched 'ellipses' at the edges of the paper for example.

(Best) way to track a circle with a cross inside

Hi,

I am currently trying to find a solution on how to track a specific target which looks like this:

target

It is just a circle with a cross inside.

I am using opencv 2.4.8 in ROS Indigo on Ubuntu 14.04 Currently I am at this point:

  • apply Canny-Edge-detection on the frames
  • find and draw contours (drawing mostly for debugging purposes)
  • for each contour calculate the eccentricity like this:

formula

I wanted to use the eccentricity to filter out most of the fitted ellipses which are very narrow and are not even close to a circle. But I can not calculate moments from the ellipses, but only from the contours. And I have no idea if this comes even close to what I want to achieve.

Is there another possibility to calculate the eccentricity or the roundness of the fitted ellipses? I think the I tried googling it and this was the most promising approach.

Am I at least on a right way to get this working anytime? Or is there another approach which would work better and/or more stable. I need a robust tracking algorithm which also works in non-perfect lightning conditions and also works if the circle is no perfect circle anymore in the picture (because the camera is not always perfectly perpendicular to the circle)

I already sorted out the following methods, which all do not work for some reasons

  • Shape-Matching
  • Template-Matching
  • Hough Circle Transform (at most perfect circles are detected)detected) HoughCircles example

If there are more information I should provide or something I should clarify, please feel free to ask. Sorry if this post should be a little messy, I hope you got me anyway.

EDIT: Here is an image from my webcam: output

On the left side, there is just the input image after Canny-Edge-detection. In the right picture you can see the original input with contours (green) and some fitted ellipses (blue). At first I want to filter out these very stretched 'ellipses' at the edges of the paper for example.

EDIT2: Added another image before any processing and an image to show my problems with HoughCircles:

raw input