Merge pull request #26530 from mshabunin:fix-usac-vector-access

calib3d: fix vector access in USAC
This commit is contained in:
Alexander Smorkalov 2024-11-26 22:15:05 +03:00 committed by GitHub
commit 68941ef8e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -579,7 +579,7 @@ public:
CameraPose pose;
pose.R = corr_idx < 2 ? R1 : R2;
pose.t = corr_idx % 2 == 1 ? -t : t;
refine_relpose(calib_points, sample, sample_size, &pose, opt, &weights[0]);
refine_relpose(calib_points, sample, sample_size, &pose, opt, weights.empty() ? nullptr : &weights[0]);
Matx33d model_new = Math::getSkewSymmetric(pose.t) * pose.R;
if (is_fundamental)
model_new = K2_inv_t * model_new * K1_inv;