handle huge matrices correctly (#11505)

* make sure that the matrix with more than INT_MAX elements is marked as non-continuous, and thus all the pixel-wise functions process it correctly (i.e. row-by-row, not as a single row, where integer overflow may occur when computing the total number of elements)
This commit is contained in:
Vadim Pisarevsky
2018-05-14 15:29:14 +03:00
committed by GitHub
parent c6a9de812b
commit e0dbe5cfcc
12 changed files with 101 additions and 101 deletions
+2 -2
View File
@@ -489,7 +489,7 @@ public class MatTest extends OpenCVTestCase {
public void testIsContinuous() {
assertTrue(gray0.isContinuous());
Mat subMat = gray0.submat(0, 0, gray0.rows() / 2, gray0.cols() / 2);
Mat subMat = gray0.submat(0, gray0.rows() / 2, 0, gray0.cols() / 2);
assertFalse(subMat.isContinuous());
}
@@ -937,7 +937,7 @@ public class MatTest extends OpenCVTestCase {
}
public void testSubmatRect() {
Mat submat = gray255.submat(new Rect(5, gray255.rows() / 2, 5, gray255.cols() / 2));
Mat submat = gray255.submat(new Rect(5, 5, gray255.cols() / 2, gray255.rows() / 2));
assertTrue(submat.isSubmatrix());
assertFalse(submat.isContinuous());