gpt4 book ai didi

opencv - 如何在 OpenCV 中显示由三个矩阵表示的图像

转载 作者:行者123 更新时间:2023-12-02 16:57:12 25 4
gpt4 key购买 nike

我有 3 个 double 格式的矩阵 (R G B),所以我只需要 OpenCV 版本的 matlab cat显示图像的功能。如果您有任何来源或引用,请发布,我将不胜感激。

最佳答案

merge() 对于这样的任务。我假设您在以下示例代码中使用 C++,但此函数也可用于 C 和 Python(请参阅文档)。

// Suppose you have 3 matrices (instances of class cv::Mat)
// named channelR, channelG and channelB that hold your data
std::vector<cv::Mat> channels;
channels.push_back(channelR);
channels.push_back(channelG);
channels.push_back(channelB);

cv::Mat outputImage;
merge(channels, outputImage);

关于opencv - 如何在 OpenCV 中显示由三个矩阵表示的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14178015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com