如何将unsigned char*图像数据封装成OpenCV中Mat类型

2025-02-26 23:37:26
推荐回答(1个)
回答1:

直接使用Mat的构造函数,把你指针的位置赋给下面中的data就OK了 //! constructor for matrix headers pointing to user-allocated data Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);