Ellipse detection with OpenCV

前端 未结 3 2040
别那么骄傲
别那么骄傲 2020-12-05 20:42

I would like to detect ellipses with OpenCV for Android, using the Tutorial 2-Basic included with OpenCV 2.4.1 package as a starting point. Note that my ellipse would be a p

相关标签:
3条回答
  • 2020-12-05 20:56

    One possible solution to your problem is similar to this thread Detection of coins (and fit ellipses) on an image .

    You should take a look a opencv's function fitEllipse.

    0 讨论(0)
  • 2020-12-05 20:59

    If you already have an idea of the sizes of the ellipses that you're looking for, then try the following steps:

    • Find Canny edges in the image
    • Use a sliding window, the size of which is the maximum length of the major axis of ellipses you're looking for.
    • Within the window, collect all edge pixels, pick 6 pixels randomly and use linear least squares to fit an ellipse in the general form.
    • Repeat the above step in a RANSAC like procedure.
    • If there are enough inliers, you have an ellipse.
    0 讨论(0)
  • 2020-12-05 21:22

    The parameters used in HoughCircles play a fundamental role. HoughCircles will detect not just perfect, but also near-perfect circles (ellipses). I suggest you check this examples:

    • How to detect circles (coins) in a photo
    • Simple object detection using OpenCV
    • OpenCV dot target detection
    • Reshaping noisy coin into a circle form

    And this answer has a decent collection of references.

    0 讨论(0)
提交回复
热议问题