3

I have the extreme/corner points of an arc, along with its radius and center coordinates. How to draw an arc using opencv using what I have? I need to draw an arc with a different color between these two points enter image description here

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Ali Rafay
  • 31
  • 3
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jun 02 '22 at 11:45
  • 1
    Corner points + center + radius overdetermine an arc, you may specify 2 points and either the radius or the center for solution to exist. Please provide a diagram (handdrawn is totally OK!) to clarify the question. Anyway, look into `cv2.ellipse` and try to express your problem in its arguments' terms. – ansgri Jun 02 '22 at 12:55
  • cv2.ellipse takes angle, but I have extreme points, how do I map these together? – Ali Rafay Jun 02 '22 at 12:58
  • Have a look at this: https://stackoverflow.com/questions/48145096/draw-an-arc-by-using-end-points-and-bulge-distance-in-opencv-or-pil – Jeru Luke Jun 02 '22 at 13:33
  • calculate vectors from circle center to each point, then calculate angle for each vector – Christoph Rackwitz Jun 02 '22 at 20:20

0 Answers0