From 3c769edea0c51f7a74693f1ac747dfe9bcb7670e Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 14 May 2015 19:54:48 +0300 Subject: [PATCH] added extra check in CalibrateDebevec to make sure the points are within the image: http://code.opencv.org/issues/4124 --- modules/photo/src/calibrate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/photo/src/calibrate.cpp b/modules/photo/src/calibrate.cpp index eda3e12..63f1818 100644 --- a/modules/photo/src/calibrate.cpp +++ b/modules/photo/src/calibrate.cpp @@ -90,7 +90,9 @@ public: for(int i = 0, x = step_x / 2; i < x_points; i++, x += step_x) { for(int j = 0, y = step_y / 2; j < y_points; j++, y += step_y) { - sample_points.push_back(Point(x, y)); + if( 0 <= x && x < images[0].cols && + 0 <= y && y < images[0].rows ) + sample_points.push_back(Point(x, y)); } } } -- 2.7.4