alexandræ français english
mathematical findings
(extended) phonetic alphabet
miscellaneous
unicode
alexandræ · distance of objects in pictures

distance of objects in pictures

march 26th, 2023

    in pictures, there are vertical and horizontal field of view angles directly given by the camera. sure, most pictures we can see might be cropped, but if we know what the original FOV angle is, and and if we know the original dimensions, it just makes the FOV angle(s) smaller (like if you crop 75% of the picture vertically, it'll just reduce the vertical FOV by 75%). in the new image's vertical FOV, the object takes up an angle of φobject = FOVvertical (rad)·vertical proportion of the object in the image (%).

    the easiest object to actually calculate the distance is a ball. if you call its real radius r ([length] in dimensional analysis), since it takes an angle φball, this means the tangent lines that intersect at the focal point (the camera) are at an angle φball. out of these sole conditions, we can work out that the distance between the camera and the ball is (1/|sin(φball/2)| − 1)R :


    it's really for more linear stuff that it got really complicated lol. the first case scenario i figured out quite easily was when you have a sort of pole directly tangent to a ball around the camera, where it's fairly trivially (heightpole/2)/|tan(φpole/2)|, where heightpole is in [length] dimensional-analysis-wise.

    however, it's significantly harder when the angle of the pole isn't exactly as nice (needless to say, most of the time lol). thankfully though, i did the hard work for y'all, but we need to introduce a shit ton of variables. the idea i had was to figure out what the upper and lower halves of the pole's angles were, so i could take φupper-half, and φlower-half instead of just φ (which i had already halved every single time for my previous calculations, so that was just the logical conclusion anyway lmao). here's the visual solution :


    so overall, you need to introduce two new variables beforehand, and then you get the distance d as desired :

δ0 = 
h
2
 · 
 sin(φupperlower) 
sin(φupper−φlower)
 · 
 1 
1+ 
 2 
 1 
tan(φupper)
 1 
tan(φlower)
 2
 1/2

α = atan 
 2 
 1 
tan(φupper)
 1 
tan(φlower)


d = 
    δ0·|sin α|     if  δ0·cos²α ≤ |cos α|·h/2
    (h²/4)+δ0²-hδ0|cos α|
    otherwise

    well, we got there in the end, somehow ! well, at least that part applies for camera type stuff, it wouldn't apply to stuff like drawings since there's no FOV, and it's less about angular curvature ; they use a different kind of perspective that's more linear most of the time...
a few finite group thingies (mainly...
lattice stuff...
alexandræ
(ɔ) 2023 – 2024, intellectual property is a scam