Fix an error in the demo code for cv::Mat::forEach
authorFangjun KUANG <csukuangfj@gmail.com>
Sat, 18 Feb 2017 09:14:29 +0000 (10:14 +0100)
committerGitHub <noreply@github.com>
Sat, 18 Feb 2017 09:14:29 +0000 (10:14 +0100)
modules/core/include/opencv2/core/mat.hpp

index 0953b36..c27f3f6 100644 (file)
@@ -1893,7 +1893,7 @@ public:
 
         // first. raw pointer access.
         for (int r = 0; r < image.rows; ++r) {
-            Pixel* ptr = image.ptr<Pixel>(0, r);
+            Pixel* ptr = image.ptr<Pixel>(r, 0);
             const Pixel* ptr_end = ptr + image.cols;
             for (; ptr != ptr_end; ++ptr) {
                 ptr->x = 255;