From 20f3b33c5f62bc26a13c7a0f9a70d1540bbe9d6e Mon Sep 17 00:00:00 2001 From: Alexander Brock Date: Wed, 22 Feb 2023 11:06:49 +0100 Subject: [PATCH] Add crop factor to fisheye computation --- rtengine/iptransform.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index aee7ae4e4..8aa471c0b 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -524,7 +524,11 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, x_d /= params->perspective.camera_scale; y_d /= params->perspective.camera_scale; if (params->perspective.camera_defish) { - const double focal_source = params->perspective.camera_focal_length * maxRadius * focal_length_in_px_factor; + const double focal_source = + params->perspective.camera_focal_length * + maxRadius * + focal_length_in_px_factor * + params->perspective.camera_crop_factor; double focal_dst = focal_source; x_d /= focal_dst; y_d /= focal_dst; @@ -1264,7 +1268,11 @@ void ImProcFunctions::transformGeneral(bool highQuality, Imagefloat *original, I x_d /= params->perspective.camera_scale; y_d /= params->perspective.camera_scale; if (params->perspective.camera_defish) { - const double focal_source = params->perspective.camera_focal_length * maxRadius * focal_length_in_px_factor; + const double focal_source = + params->perspective.camera_focal_length * + maxRadius * + focal_length_in_px_factor * + params->perspective.camera_crop_factor; double focal_dst = focal_source; x_d /= focal_dst; y_d /= focal_dst;