@@ -239,8 +239,14 @@ class ReprojectedErrorSymmetricImpl : public ReprojectionErrorSymmetric {
239239 float minv11, minv12, minv13, minv21, minv22, minv23, minv31, minv32, minv33;
240240 std::vector<float > errors;
241241public:
242- explicit ReprojectedErrorSymmetricImpl (const Mat &points_) :
243- points_mat(&points_), points ((float *) points_.data), errors(points_.rows) {}
242+ explicit ReprojectedErrorSymmetricImpl (const Mat &points_)
243+ : points_mat(&points_), points ((float *) points_.data)
244+ , m11(0 ), m12(0 ), m13(0 ), m21(0 ), m22(0 ), m23(0 ), m31(0 ), m32(0 ), m33(0 )
245+ , minv11(0 ), minv12(0 ), minv13(0 ), minv21(0 ), minv22(0 ), minv23(0 ), minv31(0 ), minv32(0 ), minv33(0 )
246+ , errors(points_.rows)
247+ {
248+ CV_DbgAssert (points);
249+ }
244250
245251 inline void setModelParameters (const Mat &model) override {
246252 const auto * const m = (double *) model.data ;
@@ -298,7 +304,12 @@ class ReprojectedErrorForwardImpl : public ReprojectionErrorForward {
298304 std::vector<float > errors;
299305public:
300306 explicit ReprojectedErrorForwardImpl (const Mat &points_)
301- : points_mat(&points_), points ((float *)points_.data), errors(points_.rows) {}
307+ : points_mat(&points_), points ((float *)points_.data)
308+ , m11(0 ), m12(0 ), m13(0 ), m21(0 ), m22(0 ), m23(0 ), m31(0 ), m32(0 ), m33(0 )
309+ , errors(points_.rows)
310+ {
311+ CV_DbgAssert (points);
312+ }
302313
303314 inline void setModelParameters (const Mat &model) override {
304315 const auto * const m = (double *) model.data ;
@@ -342,8 +353,13 @@ class SampsonErrorImpl : public SampsonError {
342353 float m11, m12, m13, m21, m22, m23, m31, m32, m33;
343354 std::vector<float > errors;
344355public:
345- explicit SampsonErrorImpl (const Mat &points_) :
346- points_mat(&points_), points ((float *) points_.data), errors(points_.rows) {}
356+ explicit SampsonErrorImpl (const Mat &points_)
357+ : points_mat(&points_), points ((float *) points_.data)
358+ , m11(0 ), m12(0 ), m13(0 ), m21(0 ), m22(0 ), m23(0 ), m31(0 ), m32(0 ), m33(0 )
359+ , errors(points_.rows)
360+ {
361+ CV_DbgAssert (points);
362+ }
347363
348364 inline void setModelParameters (const Mat &model) override {
349365 const auto * const m = (double *) model.data ;
@@ -404,8 +420,13 @@ class SymmetricGeometricDistanceImpl : public SymmetricGeometricDistance {
404420 float m11, m12, m13, m21, m22, m23, m31, m32, m33;
405421 std::vector<float > errors;
406422public:
407- explicit SymmetricGeometricDistanceImpl (const Mat &points_) :
408- points_mat(&points_), points ((float *) points_.data), errors(points_.rows) {}
423+ explicit SymmetricGeometricDistanceImpl (const Mat &points_)
424+ : points_mat(&points_), points ((float *) points_.data)
425+ , m11(0 ), m12(0 ), m13(0 ), m21(0 ), m22(0 ), m23(0 ), m31(0 ), m32(0 ), m33(0 )
426+ , errors(points_.rows)
427+ {
428+ CV_DbgAssert (points);
429+ }
409430
410431 inline void setModelParameters (const Mat &model) override {
411432 const auto * const m = (double *) model.data ;
@@ -458,8 +479,14 @@ class ReprojectionErrorPmatrixImpl : public ReprojectionErrorPmatrix {
458479 float p11, p12, p13, p14, p21, p22, p23, p24, p31, p32, p33, p34;
459480 std::vector<float > errors;
460481public:
461- explicit ReprojectionErrorPmatrixImpl (const Mat &points_) :
462- points_mat(&points_), points ((float *) points_.data), errors(points_.rows) {}
482+ explicit ReprojectionErrorPmatrixImpl (const Mat &points_)
483+ : points_mat(&points_), points ((float *) points_.data)
484+ , p11(0 ), p12(0 ), p13(0 ), p14(0 ), p21(0 ), p22(0 ), p23(0 ), p24(0 ), p31(0 ), p32(0 ), p33(0 ), p34(0 )
485+ , errors(points_.rows)
486+ {
487+ CV_DbgAssert (points);
488+ }
489+
463490
464491 inline void setModelParameters (const Mat &model) override {
465492 const auto * const p = (double *) model.data ;
@@ -512,8 +539,13 @@ class ReprojectedDistanceAffineImpl : public ReprojectionErrorAffine {
512539 float m11, m12, m13, m21, m22, m23;
513540 std::vector<float > errors;
514541public:
515- explicit ReprojectedDistanceAffineImpl (const Mat &points_) :
516- points_mat(&points_), points ((float *)points_.data), errors(points_.rows) {}
542+ explicit ReprojectedDistanceAffineImpl (const Mat &points_)
543+ : points_mat(&points_), points ((float *) points_.data)
544+ , m11(0 ), m12(0 ), m13(0 ), m21(0 ), m22(0 ), m23(0 )
545+ , errors(points_.rows)
546+ {
547+ CV_DbgAssert (points);
548+ }
517549
518550 inline void setModelParameters (const Mat &model) override {
519551 const auto * const m = (double *) model.data ;
0 commit comments