Commit a53f93ff authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #7710 from alalek:debug_check_matrelease

parents b38d29b2 d65df727
......@@ -1040,8 +1040,10 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO
int b = cv::countNonZero(intrinsicRight.isEstimate);
cv::Mat deltas;
solve(J.t() * J, J.t()*e, deltas);
intrinsicLeft = intrinsicLeft + deltas.rowRange(0, a);
intrinsicRight = intrinsicRight + deltas.rowRange(a, a + b);
if (a > 0)
intrinsicLeft = intrinsicLeft + deltas.rowRange(0, a);
if (b > 0)
intrinsicRight = intrinsicRight + deltas.rowRange(a, a + b);
omcur = omcur + cv::Vec3d(deltas.rowRange(a + b, a + b + 3));
Tcur = Tcur + cv::Vec3d(deltas.rowRange(a + b + 3, a + b + 6));
for (int image_idx = 0; image_idx < n_images; ++image_idx)
......
......@@ -689,6 +689,16 @@ void Mat::release()
datastart = dataend = datalimit = data = 0;
for(int i = 0; i < dims; i++)
size.p[i] = 0;
#ifdef _DEBUG
flags = MAGIC_VAL;
dims = rows = cols = 0;
if(step.p != step.buf)
{
fastFree(step.p);
step.p = step.buf;
size.p = &rows;
}
#endif
}
inline
......
......@@ -494,7 +494,7 @@ public class MatTest extends OpenCVTestCase {
public void testIsSubmatrix() {
assertFalse(gray0.isSubmatrix());
Mat subMat = gray0.submat(0, 0, gray0.rows() / 2, gray0.cols() / 2);
Mat subMat = gray0.submat(0, gray0.rows() / 2, 0, gray0.cols() / 2);
assertTrue(subMat.isSubmatrix());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment