From 29746ab9635953fe8784d24bc2487aad5a9a91fd Mon Sep 17 00:00:00 2001 From: Haodi Yao <20B904013@stu.hit.edu.cn> Date: Thu, 27 Nov 2025 16:34:26 +0800 Subject: [PATCH] fix(features2d): Correct pointer arithmetic in BRISK corner traversal The pointer offset to move from top-right to bottom-right was incorrect. This change corrects the pointer calculation to use the proper row stride, ensuring it lands on the correct pixel. --- modules/features2d/src/brisk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index 59a86470f6..a324f44718 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -626,7 +626,7 @@ BRISK_Impl::smoothedIntensity(const cv::Mat& image, const cv::Mat& integral, con ret_val = A * int(*ptr); ptr += dx + 1; ret_val += B * int(*ptr); - ptr += dy * imagecols + 1; + ptr += (dy + 1) * imagecols; ret_val += C * int(*ptr); ptr -= dx + 1; ret_val += D * int(*ptr);