0
votes

I am using the following code to convert an cv::Mat into dlib array2D (which is required to track objects through dlib correlation tracker)

int main()
{

cv::Mat img = cv::imread("wine_plant.jpg");
dlib::cv_image<dlib::bgr_pixel> dlib_img(img);



return 0;
}

But while debugging I get the following error message.

Error   C2440   'initializing': cannot convert from 'const cv::Mat' to 'IplImage'   yolo_cywine c:\users\antho\documents\c++\dlib-19.7\source\dlib\opencv\cv_image.h    37  

Based on other issues already opened on the same matter, I also tried this

cv::Mat img = cv::imread("wine_plant.jpg");
dlib::cv_image<unsigned char> dlib_img(img);

But same result.

Am I missing something or is there something I am doing wrong? Could you please help me out?

Thanks in advance.

1
Try this: array2d<rgb_pixel> dlib_img; dlib::assign_image(dlib_img, dlib::cv_image<bgr_pixel>(img)); - unlut
I tried that but still the same errror message 'error C2440: 'initializing': cannot convert from 'const cv::Mat' to 'IplImage' - Yannick

1 Answers