AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Focal length

Open symechar opened this issue 8 years ago • 5 comments

Is there a way to extract the camera's focal length?

symechar avatar May 04 '18 10:05 symechar

https://github.com/Microsoft/AirSim/blob/master/docs/image_apis.md#getting-camera-parameters

sytelus avatar May 08 '18 22:05 sytelus

Hello,

The link you provided does not include the "getting-camera-parameters" section. I need to know to camera's focal length and in general the calibration parameters of the camera for 3D mapping. Is it possible?

Parnia avatar Jul 16 '18 19:07 Parnia

Hello,

The link you provided does not include the "getting-camera-parameters" section. I need to know to camera's focal length and in general the calibration parameters of the camera for 3D mapping. Is it possible?

client.simGetCameraInfo(str(camera_id))

KabirovIrik avatar Feb 08 '21 20:02 KabirovIrik

There is a function called get focal length also get film back settings to get sensor info

Brez18 avatar Dec 14 '23 06:12 Brez18

I tried using the python API to get the focal length. The focal length is got was 11.9 Then, I used that to compute the 3D target object location from the pixel position (using intrinsic matrix). However, it did not match the 3D target location obtained using python API Here, by target I mean another drone. So, I wanted correspondence between the target drone location in the image and the 3D target drone location obtained using python API

I also want to share something else that I noticed through this experiment: I captured a sequence of images of the target drone from the chaser camera. The target (at a distance of 3m from chaser) was given a horizontal straight line trajectory and the chaser was kept steady. Then, I tried several values of focal length. Finally, I got the values which worked (fx=28, fy=29). The 3D target location obtained using the intrinsic matrix matched to that obtained using python API. Then, I changed the distance of the target from the chaser (7m) and conducted the same experiment. This, time those values did not work! After several trials, the values that worked were fx = 118, fy=125

So, I figured that the values of fx, fy change for different values of the distance between the camera and the target object. I am not sure of the reason though

Aditya12123 avatar Jun 29 '25 15:06 Aditya12123