From d71e001736f776777b49935f833bf61496dcc19f Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Mon, 22 Dec 2014 21:01:17 +0000 Subject: [PATCH] fix crash when sample point out of image boundaries --- modules/photo/src/calibrate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/photo/src/calibrate.cpp b/modules/photo/src/calibrate.cpp index e9fb461f5b..eda3e1265b 100644 --- a/modules/photo/src/calibrate.cpp +++ b/modules/photo/src/calibrate.cpp @@ -89,7 +89,7 @@ public: int step_y = images[0].rows / y_points; for(int i = 0, x = step_x / 2; i < x_points; i++, x += step_x) { - for(int j = 0, y = step_y; j < y_points; j++, y += step_y) { + for(int j = 0, y = step_y / 2; j < y_points; j++, y += step_y) { sample_points.push_back(Point(x, y)); } }