-
I am practicing with this example from https://github.com/roboflow/supervision/blob/develop/examples/speed_estimation/ultralytics_example.py. In the example code, there is a section that calculates coordinates C and D with the line SOURCE = np.array([[1252, 787], [2298, 803], [5039, 2159], [-550, 2159]]). I would like to understand in detail how the x-coordinates -550 and 5039 are calculated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @Yeodohoon 👋 Are you following this guide? https://blog.roboflow.com/estimate-speed-computer-vision/ If not, check it out - it may help clarify the approach. |
Beta Was this translation helpful? Give feedback.
-
Hello @LinasKo |
Beta Was this translation helpful? Give feedback.
Hi @Yeodohoon 👋🏻 In a case like the one described in the tutorial, where not all points lie on the image, I usually determine the zone geometry by trial and error.
I start by drawing a simple polygon in Colab, such as a 100x100 square. A good idea is to print the image using matplotlib. This displays a scale from which we can estimate the coordinates of the vertices of our polygon.
Looking at the vertical axis, I conclude that I want to cut off the road around y = 750. From the x-axis, I roughly estimate where points A and B should be. The remaining two points will be on the bottom edge of the image. I know the image has a resolution of (2160, 3840), so for now, I set points C and D at …