简体   繁体   English

如何从 BGR 框架 opencv C++ 获取红色通道

[英]How to get red channel from BGR frame opencv C++

    vector <Mat> sepframe;
    split(frame, sepframe );
    imshow(window_red, sepframe[2]);
    imshow(window_green, sepframe[1]);
    imshow(window_blue, sepframe[0]);

So using BGR i am able to extract channels but i imagined That while showing red channel, I will able to see atleast some red pixels.所以使用 BGR 我能够提取通道,但我想象在显示红色通道时,我将能够看到至少一些红色像素。 in all 3 channels, all i am seeing is Grayscale Images( since I passed only one channel Mat).在所有 3 个通道中,我看到的只是灰度图像(因为我只通过了一个通道垫)。 Question: How to get my imagined image.问题:如何获得我想象的图像。

    vector <Mat> sepframe;
    split(frame, sepframe );
    sepframe[1]=Mat::zeros(s, sepframe[0].type());
    sepframe[0]=Mat::zeros(s, sepframe[0].type());
    Mat res;
    merge(sepframe, res);
    redVid.write(res);

here frame reading frames of original video, And i get my desired Result Thank you.!这里是原始视频的帧阅读帧,我得到了我想要的结果谢谢。!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM