Skip to content

Commit 68941ef

Browse files
authored
Merge pull request opencv#26530 from mshabunin:fix-usac-vector-access
calib3d: fix vector access in USAC
2 parents fb422a6 + 82c45dd commit 68941ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/calib3d/src/usac/fundamental_solver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ class LarssonOptimizerImpl : public LarssonOptimizer {
579579
CameraPose pose;
580580
pose.R = corr_idx < 2 ? R1 : R2;
581581
pose.t = corr_idx % 2 == 1 ? -t : t;
582-
refine_relpose(calib_points, sample, sample_size, &pose, opt, &weights[0]);
582+
refine_relpose(calib_points, sample, sample_size, &pose, opt, weights.empty() ? nullptr : &weights[0]);
583583
Matx33d model_new = Math::getSkewSymmetric(pose.t) * pose.R;
584584
if (is_fundamental)
585585
model_new = K2_inv_t * model_new * K1_inv;

0 commit comments

Comments
 (0)