1 | initial version |
Thanks @matman for an answer!
The overhead was caused by OpenCL initialization. I added #include<opencv2 core="" ocl.hpp=""> and switched off OpenCL usage before calling merge(InputArrayOfArrays _mv, OutputArray _dst) . Now it works as I originally expected.
cv::ocl::setUseOpenCL(false) vector<cv::mat> images(numcomps); for (int i = 0; i < numcomps; i++) images[i] = cv::Mat(h, w, CV_32SC1, (image->comps + comps[i])->data); cv::merge(images, imageMat);
2 | No.2 Revision |
Thanks @matman for an answer!
The overhead was caused by OpenCL initialization. I added #include<opencv2 core="" ocl.hpp=""> #include<opencv2/core/ocl.hpp>
and switched off OpenCL usage before calling merge(InputArrayOfArrays _mv, OutputArray
_dst) _dst) . Now it works as I originally expected.
cv::ocl::setUseOpenCL(false)
3 | No.3 Revision |
Thanks @matman for an answer!
The overhead was caused by OpenCL code initialization. I added #include<opencv2/core/ocl.hpp>
and switched off OpenCL usage before calling merge(InputArrayOfArrays _mv, OutputArray _dst)
. Now it works as I expected.
cv::ocl::setUseOpenCL(false)
vector<cv::Mat> images(numcomps);
for (int i = 0; i < numcomps; i++)
images[i] = cv::Mat(h, w, CV_32SC1, (image->comps + comps[i])->data);
cv::merge(images, imageMat);