gpt4 book ai didi

image-processing - 如何用一种纯色填充 OpenCV 图像?

转载 作者:太空宇宙 更新时间:2023-11-03 20:36:25 25 4
gpt4 key购买 nike

如何用一种纯色填充 OpenCV 图像?

最佳答案

将 OpenCV C API 与 IplImage* img 结合使用:

使用cvSet() : cvSet(img, CV_RGB(redVal,greenVal,blueVal));

将 OpenCV C++ API 与 cv::Mat img 结合使用,然后使用:

cv::Mat::operator=(const Scalar& s)如:

img = cv::Scalar(redVal,greenVal,blueVal);

the more general, mask supporting, cv::Mat::setTo() :

img.setTo(cv::Scalar(redVal,greenVal,blueVal));

关于image-processing - 如何用一种纯色填充 OpenCV 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4337902/

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