cv::merge
cv::split
示例,老照片效果
void valueChanged(double blendValue) {
/* 老照片效果
*
* 0.393,0.769,0.189
* A = 0.349,0.686,0.168
* 0.272,0.534,0.131
*
* p(x,y)=(blendValue)*A*p(x,y)+(1-blendValue)*p(x,y)
*/
this->setAlgorithm([=](const QImage &arg)->QImage {
try {
cv::Mat imageInput(arg.height(),arg.width(),CV_8UC3,
const_cast<uchar*>(arg.constBits()),
arg.bytesPerLine());
cv::Mat ansMat;
{
/*准备临时数据*/
cv::Mat rgb[6];
/*转型*/
imageInput.convertTo(rgb[5],CV_32FC3);
/*分割rgb通道*/
cv::split(rgb[5