1 | initial version |
I would use Mat::convertTo
// build a cv::Mat over existing data
cv::Mat cvMatFloat(resolutionSize.y,resolutionSize.x,CV_32FC3,(void*)floatImage);
// convert to BGR image
cvMatFloat.convertTo(cvMat,CV_8UC3);
2 | No.2 Revision |
I would use build a cv::Mat over existing data than convert to BGR using Mat::convertTo
// build a cv::Mat over existing data
cv::Mat cvMatFloat(resolutionSize.y,resolutionSize.x,CV_32FC3,(void*)floatImage);
// convert to BGR image
cvMatFloat.convertTo(cvMat,CV_8UC3);