Trigonometry, the Wind, and the Stop Sign

Imagine I am 50’ away from a stop sign loosely mounted to a post. The stop sign is completely perpendicular to me in the horizontal and vertical axes. If I take a picture of the sign using my cell phone, I can then count the pixels in the image and see that the vertical dimension of the sign is identical to the horizontal dimension. It has an “aspect ratio” of 1:1.

Now, pretend the sign is mounted loosely using clamps and can rotate on the sign post. The wind can cause it to rotate on the post (the vertical axis perpendicular to my line of sight). As it rotates, it will appear to be an oval to me. The oval will get thinner and then, as it rotates to 90 degrees, appear like a thick line to me.

At any point, I can take a picture of the sign, count the pixels in the horizontal and vertical axes of the sign in the image, and calculate an “aspect ratio” of the sign. Before it starts rotating, the AR is 1:1. It then becomes 0.9:1, 0.8:1, 0.7:1, and so forth.

Knowing the AR, can I estimate how many degrees the sign has rotated on its post (vertical axis)? Again, I’m 50 feet away from it. Let’s further assume that the stop sign is 2 feet in size both horizontally and vertically. I know that an AR of 1:1 means no rotation. And I know that an AR of 0.0:1 means 90 degrees (or 270 degrees) of rotation. But in between? My trig and calculus classes are 50 years behind me.

You do realize a stop sign is octagon shaped, right? It will never appear to be oval unless you have poor vision.

Yes, you would be able to solve this. But if it was in silhouette, or without further visual cues you would not know whether it had rotated clockwise or counterclockwise, ie if rotated half way between fully square and side-on it could be rotated 45 deg or 135 deg.

I’m going with this unit circle animation

I’d think the ratio of the pixels would fit in a sine function to spit out the angle.

(how come I cant embed a YouTube video of a Unit circle animation)

The arccosine (abbreviated arccos, acos, or cos-1) of the ratio will give you the angle that it’s rotated (though, as @Banksiaman says, you won’t be able to tell just from that which way it’s rotated).

Why do we need to talk about pixels? The relationship between the size of an object and the size of its image on a photograph is nonlinear.

As the sign rotates, the side closer to the camera is displaced away from the centre of the photo. The side that is farther away is displaced toward the centre.

If we got into that it would just distract from the idea you’re examining.

It doesn’t really matter what the object’s shape is in this case, as long as you can measure it’s perceived width (or count the pixels). Whether a hexagon, circle, square, etc, count the number of pixels across the axis of rotation both before and after rotating it, and the angle of rotation will be arccos(rotated pixel count / orig pixel count).

You should come down to Lee County to test this. Every single post-mounted street sign in the County has been rotated around the vertical axis to some degree since Ian visited last September.

If the sign started off centered in the photo, then both sides will be displaced towards the center. If the sign didn’t start off centered in the photo, then the side nearer the center would be displaced away from the center, and the side further away would be displaced towards the center. Which side is closer to or further from the camera is irrelevant.

Yes, I realize that stop signs are octagonal, but, as pointed out, this really doesn’t have any impact on the fact that we can measure the (horizontal) width of the sign in the image and compare it to the (vertical) height. Since the height doesn’t change as the sign rotates, we can just use the apparent width to try to estimate the rotation.

I gave some hard numbers (2’ sign height and width, 50’ distance) hoping we could find a solution that would allow me to say, “Hey, the stop sign is 10% narrower than it is tall. Therefore, the sign has rotated 10% of 90 degrees, or 9 (or 189) degrees.” I don’t think this is the correct answer, but it conveys what I’m trying to figure out.

First of all, I had it backward. The side closer to the camera is displaced toward the centre and the and the side further from the camera is displaced away from the centre. Sorry about that. This is on top of the displacement you’re talking about from the apparent angle between the sides being smaller when the sign is seen from an angle.

Look at this page especially the section called “Basic Principal of Photogrametry” and this image.

The width is 0.9 times the height. Therefore, the angle is cos^{-1}(0.9) = 25.84º.

This seems pretty straightforward. Where’s my calculator?

Also since the sign will not be perfectly uniform, you can chose a distinctive feature or point to determine the rotational direction as well.

The OP asks about taking a picture of the sign at some point in a rotation. Just from the picture taken at a point in time you can’t tell anything about the direction of rotation.

That’s fair. I don’t really care, though.

The OP takes two pictures. The first head on and another at some point in the rotation.

That might work, depending on what point in the rotation the two pictures are taken, and knowing the rotation speed and the amount of time between the pictures. But it doesn’t work for all cases.

Excellent responses! Thank you very much.

I will now confess that I actually wanted to be able to tell how far the front wheel of a car was turned by using a photograph. The stop sign scenario made everything much simpler to describe. Because it is the front (steering) wheel of a car, it is severely limited it its rotation. It can be turned 10 degrees, but not 190 degrees.

Of course, I realize that this doesn’t take into account the more complex mounting and attachment of the wheel in a car. But I think I’ll get close enough. No difference in aspect ratio = wheel is straight. Aspect ratio 0.95 = wheel is turned about 18 degrees.

That was a response to the post above mine. It is pertinent to what you are asking about based on the limitations of a front wheel of a car rotation.

If it was hexagon shape that mattered, another means of determining the degree of rotation would be from the apparent changing angle between adjacent sides of the hexagon. One of these guys who knows math could give you a formula for that.