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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user