Fix auto perspective correction not working
Use default focal length and/or crop factor if undefined. Closes #6487.
This commit is contained in:
@@ -1022,6 +1022,16 @@ void ToolPanelCoordinator::autoPerspRequested (bool corr_pitch, bool corr_yaw, d
|
||||
rtengine::procparams::ProcParams params;
|
||||
ipc->getParams(¶ms);
|
||||
|
||||
// If focal length or crop factor are undetermined, use the defaults.
|
||||
if (params.perspective.camera_focal_length <= 0) {
|
||||
params.perspective.camera_focal_length =
|
||||
PerspectiveParams::DEFAULT_CAMERA_FOCAL_LENGTH;
|
||||
}
|
||||
if (params.perspective.camera_crop_factor <= 0) {
|
||||
params.perspective.camera_crop_factor =
|
||||
PerspectiveParams::DEFAULT_CAMERA_CROP_FACTOR;
|
||||
}
|
||||
|
||||
auto res = rtengine::PerspectiveCorrection::autocompute(src, corr_pitch, corr_yaw, ¶ms, src->getMetaData(), lines);
|
||||
rot = res.angle;
|
||||
pitch = res.pitch;
|
||||
|
Reference in New Issue
Block a user