Conversion from IplImage* to cv::MAT

前端 未结 5 438
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 20:05

I searched to convert an IplImage* to Mat, but all answers were about the conversion to cvMat.

How, can I do it? and what is the difference between Mat and cvMat?

5条回答
  •  醉梦人生
    2020-12-04 20:45

    For the records: taking a look at core/src/matrix.cpp it seems that, indeed, the constructor cv::Mat(IplImage*) has disappeared.

    But I found this alternative:

    IplImage * ipl = ...;
    cv::Mat m = cv::cvarrToMat(ipl);  // default additional arguments: don't copy data.
    

提交回复
热议问题