- See the uavCoveragePlanner feature introduced in R2023a.
- And the Survey Urban Environment Using UAV example introduced in R2022b which uses a Simulation 3D Camera block to capture images and compute these values.
How to calculate the Ground Sampling Distance of a simulation 3D camera?
1 回表示 (過去 30 日間)
古いコメントを表示
If I create a simulation 3D camera in simulink, with certain flight height, how can I calculate the GSD in meter?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/602805/image.png)
The parameters are shown in the picture.
Besides, for simulation camera, the focal length is set in pixels, how to get the focal length in milimeter?
0 件のコメント
回答 (1 件)
Siddhant Shenoy
2024 年 4 月 15 日
To calculate the Ground Sample Distance for a UAV in nadir view, you need to use the UAV's elevation and its focal length.
The Ground Sample Distance, defined by the distance on the ground in meters captured by 1 image pixel on the camera-captured image is then given as:
% Assumptions made for this formula are as follows:
% - Optical Center is at the center of the image
% - Camera is pointing perpendicularly downwards to the ground i.e. is in nadir view
% - Radial and tangential distortions of the camera are ignored by assuming them to be 0.
% - Axis skew is assumed to be 0.
% - Camera elevation is the same as the UAV elevation, small differences between the two are ignored.
% Note: These assumptions make the formula simpler to calculate.
GSD = uavElevationInMeters / focalLengthInPixels;
% For a camera with a different focal lengths on the X and Y axes, the GSDs along each axis are
uavElevationInMeters = 150;
focalLengthInPixelsAlongX = 1109;
focalLengthInPixelsAlongY = 1109;
xGSD = uavElevationInMeters / focalLengthInPixelsAlongX;
yGSD = uavElevationInMeters / focalLengthInPixelsAlongY;
The Simulation 3D Camera block uses a simulated camera with no parameter provided that allows specifying the size of the sensor. This means the focal length cannot be specified in millimeters, but only in pixels. A hypothetical meter to pixel ratio can then be computed using your display screen, to determine how many pixels are present in one meter on your screen, as follows:
% This initial value is for a screen on which 752 pixels correspond to 15.6 cm in the real world.
% If this value does not match those of your screen, determine the ratio for your monitor and
% set the meterToPixelRatio accordingly.
meterToPixelRatio = 752*100/15.6;
% Focal length in meters will then be given by
focalLengthInMeters = focalLengthInPixels / meterToPixelRatio;
For more information:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!