Your formula looks the correct one, however, for it to hold over the entire image plane, you should correct lens distortions first, e.g., following the answer
Camera calibration, reverse projection of pixel to direction
Along the way, OpenCV lens calibration module will estimate your true focal length.
Filling the formula gives
Distance = 3.67 mm * 180 mm * 1080/511 / sensor_height_mm = 1396 mm^2 / sensor_height_mm
Leaving sensor_height_mm unknown. Given your camera is 16:9 format
w^2 + h^2 = D^2
(16x)^2+(9x)^2 = D^2
<=>
x = sqrt( D^2/337 )
<=>
h = 9x = 9*sqrt( D^2/337 )
Remember the rule of 16:
https://photo.stackexchange.com/questions/24952/why-is-a-1-sensor-actually-13-2-%C3%97-8-8mm/24954
Most importantly, a 1/2.88" sensor has 16/2.88 mm image circle diameter instead of 25.4/2.88 mm. Funny enough, the true image circle diameter is metric. Thus the sensor diameter is
D = 16 mm/ 2.88 = 5.556 mm
and
sensor_height_mm = h = 2.72 mm
giving
Distance = 513 mm
Note, that this distance is measured with respect to the lenses first principal point and not the sensor position or the lens front element position.
As you correct the barrel distortion, the reading should get more accurate. It's quite a lot for this camera. I have similar.
Hope this helps.
Answer from mainactual on Stack OverflowSo wanted to buff my stream camera logitech c920 and also got a camera to record vids and photos. I thought 35mm is wide enough but for streams it is not as wide as logitech c920 webcam. I look at the focal length of c920 and couldn’t calculate what it means as a classic camera focal length as it says it is 3.67 mm. What if I want the same focal length of that webcam for a dslr or mirrorless which focal length would be equal to that?
Webcam that resembles the human eye
Logitech C920 - Focal Distance?
How can I know the focal length and sensor size of my webcam? - Photography Stack Exchange
Videos
I've been trying to set up my C920 to capture a top down view of my desk, but I'm having a bit of a nightmare trying to get a half decent focus.
It seems that when the focus slider is at 0, focus is at infinite and almost everything is clear including myself and the background. Anything less than 0, and the focus is insanely close.
Like, microscope close. Anything over about 20cm away from the webcam just needs focus set to 0.
Considering how far away I have to sit from the camera simply to get myself in frame, it almost seems as if the focus of the camera is totally wasted and I need to just leave it on 0 permanently.
I tried disassembling the camera to adjust the focus manually, but while it was clearly having an effect I had no success. It seems that all it did was readjust what the slider could do, rather than moving where the focus was effective.
If I turned it clockwise, then infinite focus would move to about 50 on the slider, but everything below 50 was divergent and guaranteed to be out of focus.
If I turned it anti-clockwise, then it would basically just move the "0" point to a negative value, which obviously couldn't be set. I had fantastically fine control over the focus about 10cm from the camera, but anything beyond that was impossible to focus with.
Any ideas? The camera is hardly unusable, but it seems a bit insane that all of the focal variance is 10-20cm from the lens and pretty much everything else is pointless.
Thanks
It seems your question has been asked earlier but seperately..
Here, this will tell you how to find the focal length.
And this might help in finding sensor size.
Hope this helps.
Calculation goes as following. Angle of view will define effective (in 35mm sense) focal length of the lens. 58 degrees of angle of view will give you roughly 39mm focal length (if angle is measured diagonally).
Your lens is (let's say) 6 mm by spec, that is 39/6=6.5 times smaller. Which means that sensor has crop factor of 6.5 (consider 1.5 for Nikon's DX). That means that sensor size (if it is 3:2 ratio) is 36x24mm / 6.5 = 5.5x3.7mm rectangle.
Final thought. I believe your camera has about 500K real pixels, which means that single pixel area is about (6.4um)^2, which seems reasonable for CMOS sensors.