diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 0953b362b9..c27f3f6c6a 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -1893,7 +1893,7 @@ public: // first. raw pointer access. for (int r = 0; r < image.rows; ++r) { - Pixel* ptr = image.ptr(0, r); + Pixel* ptr = image.ptr(r, 0); const Pixel* ptr_end = ptr + image.cols; for (; ptr != ptr_end; ++ptr) { ptr->x = 255;