1
我想通过Zed摄像头而不是通常的网络摄像头检索输入,将dlib与zed 3D摄像头集成到他们的webcam_face_pose_ex中。转换openCV垫到Dlib的图像
当试图匹配由dlib使用的捕获图像矩阵时,会出现该问题。在DLIB我的简历::垫转换,我从Zed的相机获取的是在是的例子中使用如下DLIB的特殊格式的图像:
cv::Mat temp = sl::zed::slMat2cvMat(left); // converts the zed Mat to openCV mat
cv_image<bgr_pixel> cimg(temp); // converts the opencv matrix to dlib matrix`
我收到以下错误,当做第二个步骤如下:
Error detected at line 36.
Error detected in file /home/yomna/Resources/apps/dlib/dlib-master/dlib/../dlib/opencv/cv_image.h.
Error detected in function dlib::cv_image<pixel_type>::cv_image(cv::Mat) [with pixel_type = dlib::bgr_pixel].
Failing expression was img.depth() == cv::DataType<typename pixel_traits<pixel_type>::basic_pixel_type>::depth && img.channels() == pixel_traits<pixel_type>::num.
The pixel type you gave doesn't match pixel used by the open cv Mat object.
img.depth(): 0
img.cv::DataType<typename pixel_traits<pixel_type>::basic_pixel_type>::depth: 0
img.channels(): 1
img.pixel_traits<pixel_type>::num: 3
你知道什么地方错了OpenCV的图像矩阵的DLIB格式可能会导致这样的转换?