小弟最近在嵌入式上做人脸识别,摄像头程序是自己基于v4l2写的,现在想把unsigned char*的图片数据转化为Mat,用来进行识别。代码如下
video_mat=Mat(640,480,CV_8UC1,(uchar*)src_buff);
然后在嵌入式平台运行出现如下报错
OpenCV Error:Null pointer(The matrix has NULL data pointer) in cvGetMat,file cxcore/cxarray.cpp,line 2375
Qt has caught an exception thrown an event handler,Throwing exceptions from an event handler is not support in Qt.You must reimplement QApplication::notify() and catch all exceptions there.
terminate called after throwing an instance of ‘cv::Exception’Aborted
请教大哥大姐们如何封装unsigned char *的图片数据为Mat?
|