optical_flow: Use cv::Mat(std::vector, bool) ctor for dist_coeffs_

This commit is contained in:
Alexey Rogachevskiy
2020-05-26 22:05:02 +03:00
committed by Oleg Kalachev
parent 98d5d50607
commit b85326c02a

View File

@@ -35,7 +35,6 @@ class OpticalFlow : public nodelet::Nodelet
public:
OpticalFlow():
camera_matrix_(3, 3, CV_64F),
dist_coeffs_(8, 1, CV_64F),
tf_listener_(tf_buffer_)
{}
@@ -91,9 +90,7 @@ private:
camera_matrix_.at<double>(i, j) = cinfo->K[3 * i + j];
}
}
for (int k = 0; k < cinfo->D.size(); k++) {
dist_coeffs_.at<double>(k) = cinfo->D[k];
}
dist_coeffs_ = cv::Mat(cinfo->D, true);
}
void drawFlow(Mat& frame, double x, double y, double quality) const