From 3cfe7b9af99aaeb4ca7d387f78134896c7b3456d Mon Sep 17 00:00:00 2001 From: Tomoaki Teshima Date: Sun, 24 Jan 2021 20:29:52 +0900 Subject: [PATCH] fix wrong index --- modules/cudalegacy/src/calib3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cudalegacy/src/calib3d.cpp b/modules/cudalegacy/src/calib3d.cpp index b58ca3a98d..03d05be045 100644 --- a/modules/cudalegacy/src/calib3d.cpp +++ b/modules/cudalegacy/src/calib3d.cpp @@ -283,7 +283,7 @@ void cv::cuda::solvePnPRansac(const Mat& object, const Mat& image, const Mat& ca p_transf.z = rot[6] * p.x + rot[7] * p.y + rot[8] * p.z + transl[2]; p_proj.x = p_transf.x / p_transf.z; p_proj.y = p_transf.y / p_transf.z; - if (norm(p_proj - image_normalized.at(0, i)) < max_dist) + if (norm(p_proj - image_normalized.at(i)) < max_dist) inliers->push_back(i); } }