diff --git a/dlib/opencv/to_open_cv.h b/dlib/opencv/to_open_cv.h index f5756f159..02b7bf6fc 100644 --- a/dlib/opencv/to_open_cv.h +++ b/dlib/opencv/to_open_cv.h @@ -24,9 +24,10 @@ namespace dlib return cv::Mat(); typedef typename image_traits::pixel_type type; + typedef typename pixel_traits::basic_pixel_type basic_pixel_type; if (pixel_traits::num == 1) { - return cv::Mat(num_rows(img), num_columns(img), cv::DataType::type, image_data(img), width_step(img)); + return cv::Mat(num_rows(img), num_columns(img), cv::DataType::type, image_data(img), width_step(img)); } else {