Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect an arc from an image contour or edge

I am trying to detect arcs inside an image. The information that I have for certain with me is the radius of the arc. I can try and maybe get the centre of the circle whose arc I want to identify.

Is there any algorithm in Open CV which can tell us that the detected contour ( or edge from canny edge is an arc or an approximation of an arc)

Any help on how this would be possible in OpenCV with Python or even a general approach would be very helpful

Thanks

like image 271
Mayank Bansal Avatar asked Oct 25 '25 04:10

Mayank Bansal


1 Answers

If you think that there will not be any change in the shape (i mean arc won't become line or something like this) then you can have a look a Generalized Hough Transform (GHT) which can detect any shape you want.

Cons:

  • There is no directly function in openCV library for GHT but you can get several source code at internet.

  • It is sometimes slow but can become fast if you set the parameters properly.

  • It won't be able to detect if the shape changes. for exmaple, i tried to detect squares using GHT and i got good results but when square were not perfect squares (i.e. rectangle or something like that), it didn't detect.

like image 145
skm Avatar answered Oct 26 '25 19:10

skm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!