We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
很感谢你的代码,我想问问为什么在使用opencv滤镜时原图看起来偏蓝???这个是什么导致的呢
The text was updated successfully, but these errors were encountered:
OpenCV中Mat矩阵颜色是按照BGR来储存的,转成UIImage之后,是按照RGB来的。 所以在转换为UIImage之前,需要将Mat中的BGR转换为RGB;
cvtColor( InputArray src, OutputArray dst, CV_BGR2RGB );
在Demo中我将视频输出CMSampleBufferRef直接转为了Mat矩阵cv::Mat imgMat;,然后用MatToUIImage(imgMat)转换为UIImage,所以看起来偏蓝;
想保持原样这样写即可: cv::Mat rgbImgMat; cv::cvtColor(imgMat, rgbImgMat, CV_BGR2RGB); UIImage *outImg = MatToUIImage(rgbImgMat);
cv::Mat rgbImgMat;
cv::cvtColor(imgMat, rgbImgMat, CV_BGR2RGB);
UIImage *outImg = MatToUIImage(rgbImgMat);
Tips: 视频图像处理计算量很大,大部分需求都不需要RGBA的4通道彩色图像,一般都是转换为单通道的灰色图像处理,计算速度倍升;例如图像识别,图像标识,识别后与原图像叠加即可。
Sorry, something went wrong.
非常感谢回复,也谢谢你的程序,对于我这种初学者帮助很大!
No branches or pull requests
很感谢你的代码,我想问问为什么在使用opencv滤镜时原图看起来偏蓝???这个是什么导致的呢
The text was updated successfully, but these errors were encountered: