-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
CV_8UC3 Mat not convertible to ocl::Image2D #8108
Copy link
Copy link
Closed
Labels
question (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.orgask questions and other "no action" items here: https://forum.opencv.org
Description
OpenCV version: 3.1.0
Example code:
#include "opencv2/imgproc.hpp"
#include "opencv2/core/ocl.hpp"
int main() {
cv::UMat m(10, 10, CV_8UC3);
cv::ocl::Image2D i2d(m);
return 0;
}gives:
OpenCV Error: Unknown error code -220 (Image format is not supported) in init, file /build/opencv/src/opencv-3.1.0/modules/core/src/ocl.cpp, line 5917
terminate called after throwing an instance of 'cv::Exception'
what(): /build/opencv/src/opencv-3.1.0/modules/core/src/ocl.cpp:5917: error: (-220) Image format is not supported in function init
I glanced at the code. Image2D::Impl::getImageFormat in modules/core/src/ocl.cpp writes:
static const int channelOrders[] = { -1, CL_R, CL_RG, -1, CL_RGBA };If I'm not wrong, 3-channel images are not supported by design. But It seems strange not to support common RGB image as there is CL_RGB channel order in OpenCL.
I think commit da5b316 brought in the change, but commit log didn't give much info. Any reason why?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
question (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.orgask questions and other "no action" items here: https://forum.opencv.org