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

[sfmData] ImageInfo: Add support for ARRI- and DJI-specific focal length metadata #1759

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

cbentejac
Copy link
Contributor

@cbentejac cbentejac commented Oct 15, 2024

Description

This PR adds the support for the detection of the focal length from the metadata of some ARRI cameras and DJI drones.

For DJI drones, the metadata is provided in the focal_length entry as a "[xxx,yyy]" string, with "xxx" the focal length and "yyy" the factor to divide it with so that it is in millimeters.

For ARRI cameras, the 'axialNominalFocalLength` entry was already detected, but assumed the focal length to already be in millimeters. It can actually also be provided in µm, meaning that it will need a conversion. To distinguish both cases, we check whether the focal length is larger than 9999 and if so, apply the conversion from µm to mm.

@cbentejac cbentejac self-assigned this Oct 15, 2024
@cbentejac cbentejac added this to the 3.3.0 milestone Oct 15, 2024
}

// Focal length is provided in µm, hence the required division
focalLength = std::stod(focalLengthStr) / std::stod(focalLengthDividerStr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::stod is throwing, maybe you should catch error ?

@servantftechnicolor servantftechnicolor merged commit f784cd3 into develop Oct 16, 2024
3 of 4 checks passed
@servantftechnicolor servantftechnicolor deleted the dev/focalLength branch October 16, 2024 12:34
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.

2 participants