Ask Your Question

Revision history [back]

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2;
    output[1] = p[1] * 0.3;
    output[2] = p[2] * 0.4;
    merge(output, res);

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2;
    output[1] = p[1] * 0.3;
    output[2] = p[2] * 0.4;
    merge(output, res);

PS in opencv it is not RGB but BGR

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2;
    output[1] = p[1] * 0.3;
    output[2] = p[2] * 0.4;
    Mat res;
    merge(output, res);

PS in opencv it is not RGB but BGR

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2;
0.2+ p[1] * 0.3+p[2] * 0.4;
    output[1] = p[1] * 0.3;
....;
    output[2] = p[2] * 0.4;
.....;
    Mat res;
    merge(output, res);

PS in opencv it is not RGB but BGR

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2+ p[1] * 0.3+p[2] * 0.4;
    output[1] = ....;
p[0] * 0.4+ p[1] * 0.5+p[2] * 0.6;
    output[2] = .....;
p[0] * 0.7+ p[1] * 0.8+p[2] * 0.9;
    Mat res;
    merge(output, res);

PS in opencv it is not RGB but BGR

I think you can split data and later merge it if necessary :

    Mat picture = imread("picture.png", CV_LOAD_IMAGE_COLOR);
    vector<Mat> p;
    split(image, p);
    vector<Mat> output(p.size());
    output[0] = p[0] * 0.2+ p[1] * 0.3+p[2] * 0.4;
    output[1] = p[0] * 0.4+ p[1] * 0.5+p[2] * 0.6;
    output[2] = p[0] * 0.7+ p[1] * 0.8+p[2] * 0.9;
    Mat res;
    merge(output, res);

and see this answer

PS in opencv it is not RGB but BGR