diff --git a/modules/gpu/test/test_labeling.cpp b/modules/gpu/test/test_labeling.cpp index 4eccbf93d6..c56fc0ef83 100644 --- a/modules/gpu/test/test_labeling.cpp +++ b/modules/gpu/test/test_labeling.cpp @@ -135,7 +135,7 @@ namespace { int outliers = 0; for (int j = 0; j < image.rows; ++j) - for (int i = 0; i < image.cols; ++i) + for (int i = 0; i < image.cols - 1; ++i) { if ( (_labels.at(j,i) == gpu.at(j,i + 1)) && (diff.at(j, i) != diff.at(j,i + 1))) {