0

I have a black line and red line. I want to calculate the distance or error value between red pixel points (error line) in the image and the black line (target line) in the most efficient and fastest way. How can I do it? Is there any opencv-python function?

this is the example of the image:

1

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
  • 1
    What have you tried so far? – Klaus D. Jan 05 '23 at 06:53
  • How is the data stored? Do you have the (x, y) coordinates of the point and the line? – DobbyTheElf Jan 05 '23 at 08:35
  • for every point in the red path, find the shortest distance to the "black" rectangle. that's a geometry problem. -- this isn't an image processing problem. *surely* you don't just have a *plot* of these paths, you have *the points* they consist of, right? – Christoph Rackwitz Jan 05 '23 at 09:20
  • @DobbyTheElf. yes, I have the (x,y) coordinates of the point of the red line – Yosua Wijaya Jan 05 '23 at 23:32
  • 1
    Then you have a geometry problem, not an image processing problem, and it has already been answered [here](https://stackoverflow.com/questions/39840030/distance-between-point-and-a-line-from-two-points). – DobbyTheElf Jan 06 '23 at 06:52

0 Answers0