convert Matrix of type CV_32FC1 to CV_64FC1

前端 未结 1 1380
说谎
说谎 2021-01-31 14:27

How do I convert a cv::Mat of type CV_32FC1 to the type CV_64FC1 (equivalent to a change from float to double)?

I am opening a Matrix that was saved as XML (cvSave

相关标签:
1条回答
  • 2021-01-31 15:21

    Okay, I'm a dimwit. Here is how it goes:

    There is the function convertTo that does exactly what I want.

    Thanks for matrix type conversion in opencv for pointing this out.

    Here is how I do it:

    cv::Mat A = loadMat("mymat.xml"); // See function loadMat in the question!
    A.convertTo(A, CV_64F);
    
    0 讨论(0)
提交回复
热议问题