In this blog and video he mentions using the far points and known y distance to calculate the x value but doesn’t provide any details. Can anyone provide a more detailed explanation? I can’t figure it out with similar triangles or trying trapezoid equations.
Hi @Ghbvx I’m the author of this blog post and video. Could you be a bit more specific? What parts of perspective transformation are you having trouble with? You should find most of the details in the Picking the source and target region of interest
image."
Hi Piotr it’s just the X values for the bottom part of the ROI of -550 and 5039. There’s a YouTube comment from the Robo flow channel that says using A and B points and info about y to get the X values. It’s not clear to me though what is being used there. It doesn’t seem like similar triangles or using the midpoint of A and B and right triangles. Could you clarify how you used A and B plus the distance to the bottom of the image to get the X values? https://youtube.com/watch?v=uWP6UjDeZvY&lc=UgwUXrKcW2UMwnLHrQZ4AaABAg.9zaIIMxFwze9zaZPK5YzCN&si=iH1Y98ftkR3wfDhE
@Ghbvx I’ll give my two cents if it helps. At first I thought he used the 250m measurement on the side of the trapezoid, but then I realized that because of perspective that doesn’t work to translate to pixels. So just to see what happened, I used a protractor on the image to find the angle for ACD and it was about 35°. You might know from there what to do, but in case anyone else comes along and just to save you the trouble of mathing it, I’ll keep going.
Dropping a perpendicular line from A to side CD, you know that is 1372px because we have the A and C y-coordinates. Then for a right triangle we can use tan(35°) = 1372/x we get an x = 1959. So referring to the x-coordinate of A we can find the corner x-coordinate with 1252 - 1959 = -707, which is in the ballpark of his -505.
Just for fun, if we start with his -505 we can get the angle he used. The bottom edge of the triangle is 505+1252 = 1757. Then tan(x) = 1372/1752 so x = 38° for his calculation.
You can go through the same process on the other side, but I actually remeasured instead of assuming the same angle and that angle is more like 25° so it does seem different. (And again, backing into it he appeared to use 26.6°)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.