Skip to content

Focal length changes with change in distance between the camera and the object #5030

@Aditya12123

Description

@Aditya12123

Bug report

  • AirSim Version/#commit:
  • UE/Unity version: Used binaries of open source environments
  • autopilot version:
  • OS Version:

What's the issue you encountered?

I tried using the python API to get the focal length of the camera mounted on the drone. The focal length I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions