Merge pull request #7733 from alalek:debug_check_matrelease_2.4

pull/7739/head
Alexander Alekhin 8 years ago
commit ac118aee78
  1. 6
      modules/calib3d/src/fisheye.cpp
  2. 10
      modules/core/include/opencv2/core/mat.hpp

@ -1028,8 +1028,10 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO
int a = cv::countNonZero(intrinsicLeft.isEstimate);
int b = cv::countNonZero(intrinsicRight.isEstimate);
cv::Mat deltas = J2_inv * J.t() * e;
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)

@ -368,6 +368,16 @@ inline void Mat::release()
data = datastart = dataend = datalimit = 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
refcount = 0;
}

Loading…
Cancel
Save