MATLAB Simulate 3D Camera: why is there no focal length (world units) attribute in the sensor model?
Show older comments
In the 3D camera simulation (https://www.mathworks.com/help/driving/ref/simulation3dcamera.html) - there is no specific focal length (mm) for the camera intrinsics. I'm working on feature tracking using the camera feed and I cannot estimate the 3D location of a point without knowing the focal length or the scaling factor (w) in (https://www.mathworks.com/help/vision/ug/camera-calibration.html).
It would also be great if MATLAB provides a DEM of the UAV scenarios - ground truth for many applications.
Please advise.
Answers (1)
Qu Cao
on 1 Jun 2022
0 votes
Please take a look at this page:
If you know the size of the pixel in world units, you can convert focal length in world units (usually mm) to focal length in pixels.
6 Comments
Ram Bhaskara
on 1 Jun 2022
Qu Cao
on 1 Jun 2022
By camera plane, do you mean where the camera is placed? The Orientation and Location outports output the location and orientation of the camera sensor. In addition, the Depth outport gives you the distance from an object to the camera plane.
Ram Bhaskara
on 1 Jun 2022
Qu Cao
on 1 Jun 2022
Is imageToVehicle what you need? It converts a 2-D image point to a 3-D point on the ground in the vehicle coordinate system.
Qu Cao
on 1 Jun 2022
Given the following equations:
X = (u - cx) * Z / fx;
Y = (v - cy) * Z / fy;
where [X, Y, Z] is the 3-D point location, [u, v] is the corresponding image point location, and [fx, fy] is the focal lengths. You should be able to compute the factor you were talking about. Note that the Depth port outputs the Z values.
Ram Bhaskara
on 2 Jun 2022
Edited: Ram Bhaskara
on 2 Jun 2022
Categories
Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!