0
votes

I created dll for dlib for face landmark detection, in opencv we get the image in MAT but here in dlib the we get it by using array2d, so any one say how to convert the mat to array2d ??

The full code can be seen viewed here

1
Your title says convert to string, not to array2d. - sashoalm

1 Answers

2
votes

You can try to use cv_image, such as:

cv::Mat temp;
...
cv_image<bgr_pixel> image(temp);

// Detect faces 
std::vector<rectangle> faces = detector(image);

Also note that this just wraps the cv::Mat object and doesn't copy anything. So image is only valid as long as temp is valid. This basically means you shouldn't modify temp while using image.