Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for DJI Air 3 Drone #28

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Pradip-p
Copy link
Collaborator

Description

This PR introduces support for the DJI Air 3 drone, alongside the existing support for DJI Mini 4 Pro. Key enhancements include adding drone-specific constants such as Vertical FOV, Horizontal FOV, and GSD-to-AGL constant for the DJI Air 3.

@Pradip-p Pradip-p requested a review from nrjadkry December 24, 2024 08:43
@Pradip-p Pradip-p self-assigned this Dec 24, 2024
@Bin-ze
Copy link

Bin-ze commented Dec 25, 2024

DJI_AIR_3 = {
        # Constants (For DJI Air 3)
        # Vertical Field of View (FOV):
        # Formula: Vertical FOV = 2 * tan^(-1)(sensor height / 2 * focal length)
        # The vertical FOV for DJI Air 3 is calculated as: 2 * tan^(-1)(6.3 / (2 * 19.4)) ≈ 0.3224 radians
        "VERTICAL_FOV": 0.3224,

        # Horizontal Field of View (FOV):
        # Formula: Horizontal FOV = 2 * tan^(-1)(sensor width / 2 * focal length)
        # The horizontal FOV for DJI Air 3 is calculated as: 2 * tan^(-1)(8.4 / (2 * 19.4)) ≈ 0.4269 radians
        "HORIZONTAL_FOV": 0.4269,

        # Ground Sampling Distance constant (GSD to AGL constant):
        # GSD = (sensor height / focal length) * AGL
        # This constant helps in determining the ground resolution per pixel at a given altitude (AGL).
        "GSD_to_AGL_CONST": 30.5,
    }

FOV units is radians, but :

    forward_photo_height = agl * VERTICAL_FOV 
    side_photo_width = agl * HORIZONTAL_FOV 

why is that?

GSD_to_AGL_CONST is Scale Factor:

GSD = (sensor height / focal length * image_height_pixel) * AGL

so:

GSD_to_AGL_CONST = (focal length * image_height_pixel / sensor height)

I would like to know the basis of your comment. I think it is impossible to calculate the correct result based on the formula in the comment.

I am a novice and have just studied route calculation for 2 days. I hope to get your help.

@Pradip-p
Copy link
Collaborator Author

@Bin-ze

Why Use FOV to Calculate Forward Photo Height and Side Photo Width?

The formulas:

forward_photo_height = AGL * VERTICAL_FOV
side_photo_width = AGL * HORIZONTAL_FOV

are based on the relationship between the Field of View (FOV) and the area captured on the ground by the camera at a given altitude above ground level (AGL).

Basis

The Field of View (FOV) describes the angular extent of the camera's view. When the drone is at an altitude (AGL), the area captured on the ground forms the base of a cone. The dimensions of this base (ground footprint) are proportional to the altitude.

Since VERTICAL_FOV and HORIZONTAL_FOV are given in radians, the height and width of the photo on the ground can be approximated as:

forward_photo_heightAGL * VERTICAL_FOV
side_photo_widthAGL * HORIZONTAL_FOV

This approximation works for small angles

About the GSD_to_AGL_CONST Calculation

Thanks for pointing that out! I’ll update the formula and the value for GSD. I found the correct GSD formula in a research paper, which is:

GSD = (Sensor_width × Flying_height × 100) / (Focal_length × Image_width)

Source Reference:

For further reading, you can refer to this research paper that explains the GSD formula in more detail:
[The Impact of UAV Flight Planning Parameters on Topographic Mapping Quality Control](https://www.researchgate.net/publication/333618810_The_impact_of_UAV_flight_planning_parameters_on_topographic_mapping_quality_control)

please let me know if I missed something or misunderstood your point. I'm happy to collaborate further and refine this explanation if needed.

Thanks for bringing this up!

@Bin-ze
Copy link

Bin-ze commented Dec 26, 2024

I think forward_photo_height and side_photo_width can be calculated using a more concise formula,According to the principle of similar triangles:

  forward_photo_height / AGL = Image_height / Image_focal
so: 
  forward_photo_height = AGL * (Image_height / Image_focal) 

  (Image_height / Image_focal) is fixed Parameters in same drone type.

Regarding GSD_to_AGL_CONST, the calculation method you mentioned is the same as mine, so I have no doubts.

My question is just why forward_photo_height can be calculated relatively accurately, but an approximation is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants