Calculation of angle of rear wing of race car above x axis from an image

I am planning an application measuring the angle of rear wing of race car from image or realtime video (from lateral perspective target angle from this kind of image).

This is the equation I am considering to calculate the the actual distance of a certain object of image in order to get the required coordinates to find the target angle.

$$F = (P x D) / W$$

$$F$$ - focal length of camera

$$P$$ - width of the object in pixel

D - actual distance of object from camera

$$W$$- actual width of the object

If only $$F$$, $$P$$ and $$W$$ were known. The actual distance of the object can be calculated.

Next, to triangularize the plane of interest to right angled triangle, 3 points of the wing are defined and their coordinates can be gotten from the previously calculated distance.

Finally, apply the equation: tangent theta = y/x to get the angle.

Do you think this actually work for my case?

Any other method that is more efficient to get the angle?

Thanks!

• I do not see how you intend to use Pythagoras' Theorem to measure an angle. You might want to give some more description (perhaps an illustration) as your question is not very clear. – The Long Night Oct 25 '18 at 5:31
• I have added a photo to make it clear. Isn't the tangent theta = y/x by Pythagoras' Theorem? Just secondary school level math. – anndexi99 Oct 25 '18 at 5:43
• No, that is not a consequence of the Pythagoras Theorem. – The Long Night Oct 27 '18 at 9:49
• oops, I shouldn't have mentioned Pythagoras but the equation for calculating tangent theta is quite well-known. Applying it properly shouldn't have any problem, right? – anndexi99 Oct 27 '18 at 16:37
• Certainly, measuring an angle given the sides is not a big problem, just not something that we can do with PT :-) – The Long Night Oct 28 '18 at 14:16

The formula $$F = {P \cdot D}/{W}$$ applies to something whose width is measured along a line parallel to the focal plane of the camera. If you have an object that is not aligned with that plane, the equations get more complicated.

Even when the formula applies perfectly, to use it accurately you have to know $$W$$ accurately for all objects to which you apply this formula. Where is $$W$$ measured on the objects in the photo?

Estimation of distance using an actual image also has uncertainty due to the small angle typically subtended by the objects in the picture. The measurement $$P$$ may only have a very small percentage uncertainty due to the size of the pixels in the camera, but that same percentage uncertainty they applies to $$D,$$ and since $$D$$ is fairly large this can translate to significant uncertainty in position relative to the car. (This is assuming you know $$W$$ very accurately; if not, things are worse.)

On the other hand, in this particular photo we can see streaks on the image of the track that are produced by having the camera track the car during the exposure. (A camera fixed to the ground would have given a sharp image of the track surface and a blurred image of the car.) From this, it seems the rectangular plates on each end of the airfoil are parallel to the car's direction of travel. So you just need to figure out the angle with respect to the rectangular plate.

You can estimate the positions of both edges of the airfoil relative to the edges of the rectangles simply by comparing the length of each edge in the image with the parallel distances from the airfoil to the adjacent edge of the rectangle. So, assuming these plates really are rectangles, if you know (or can estimate) the ratio of the sides of the rectangle, you can construct a right triangle with hypotenuse along the airfoil's chord and one leg parallel to the track, and get the angle of the airfoil.

Based on the appearance of the plates at the viewing angle in your image, it seems the ratio of their lengths in the image might be a reasonable estimate of the actual ratio of lengths.

If you had a photo of a car from a very different angle, for example if the photo were taken from some place far in front of the car, it might be much more difficult to get an accurate measurement of the angle of the airfoil.

• Excellent answer! Actually the client only have rough estimate of the size of the whole car. I can just roughly estimate the size and angle of direction of travel based on the ratio of the height of rectangular plane to the height of the car. I am also considering the dot product of 2 vectors approach - theta = arccos(a·b/ |a||b|) but I don't know how to decide the direction and magnitude of the 2 vectors and not sure if it can apply to this case or I should stick to the approach in your answer. – anndexi99 Oct 28 '18 at 2:30