mardi 9 juillet 2019

How Can I make it faster in c++11 with std::vector?

I have cv::Mat Mat_A and cv::Mat Mat_B both are (800000 X 512) floats

and below code is looks slow .

int rows = Mat_B.rows;
cv::Mat Mat_A = cv::repeat(img, rows, 1, Mat_A);
Mat_A = Mat_A - Mat_B
cv::pow(Mat_A,2,Mat_A)
cv::reduce(Mat_A, Mat_A, 1, CV_REDUCE_SUM);
cv::minMaxLoc(Mat_A, &dis, 0, &point, 0);

How Can I do this in std::vector ?

I think it should be faster.

In my 2.4 Ghz mabook pro it took 4 sec ? very slow.

Best

Aucun commentaire:

Enregistrer un commentaire