How to calculate the Ground Sampling Distance of a simulation 3D camera?

30 views (last 30 days)
If I create a simulation 3D camera in simulink, with certain flight height, how can I calculate the GSD in meter?
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?

Answers (1)

Siddhant Shenoy
Siddhant Shenoy on 15 Apr 2024 at 14:56
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:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!