mirror of https://github.com/davisking/dlib.git
Fixed some bugs in toMat() which prevented it from compiling sometimes.
This commit is contained in:
parent
9a27c170cf
commit
613558feb1
|
@ -21,14 +21,14 @@ namespace dlib
|
|||
typedef typename image_type::type type;
|
||||
if (pixel_traits<type>::num == 1)
|
||||
{
|
||||
return cv::Mat(img.nr(), img.nc(), cv::DataType<type>::type, &img[0][0], img.width_step());
|
||||
return cv::Mat(img.nr(), img.nc(), cv::DataType<type>::type, (void*)&img[0][0], img.width_step());
|
||||
}
|
||||
else
|
||||
{
|
||||
int depth = sizeof(typename pixel_traits<type>::basic_pixel_type)*8;
|
||||
int channels = pixel_traits<type>::num;
|
||||
int type CV_MAKETYPE(depth, channels);
|
||||
return cv::Mat(img.nr(), img.nc(), type, &img[0][0], img.width_step());
|
||||
int type = CV_MAKETYPE(depth, channels);
|
||||
return cv::Mat(img.nr(), img.nc(), type, (void*)&img[0][0], img.width_step());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue