当前位置:网站首页>opencv scalar传入三个参数只能显示黑白灰问题解决
opencv scalar传入三个参数只能显示黑白灰问题解决
2022-07-07 21:50:00 【王柏~】
出错代码为:
cv::Mat img2(h, w, CV_8UC1, cv::Scalar(0, 255, 0));
scalar中传入的三个参数分别为BGR,上面这个函数我希望产生的是一个绿色的图片,然而实际上产生的却是白色的。
问题处在第三个参数,参数为CV_8UC1的时候表示产生的是黑白灰图案。需要将参数修改为CV_8UC3,这个时候就可以产生正确结果了。
cv::Mat img2(h, w, CV_8UC3, cv::Scalar(0, 255, 0));
边栏推荐
- QT graphicsview graphical view usage summary with flow chart development case prototype
- Debezium series: source code reading snapshot reader
- Unity dynamically merges mesh textures
- How to operate DTC community?
- 网格(Grid)
- 关于海康ipc的几个参数
- 今日创见|企业促进创新的5大关键要素
- Knowledge drop - PCB manufacturing process flow
- Txt file virus
- V20变频器手自动切换(就地远程切换)的具体方法示例
猜你喜欢

Line test - graphic reasoning - 3 - symmetric graphic class

微信论坛交流小程序系统毕业设计毕设(8)毕业设计论文模板

What does the model number of asemi rectifier bridge kbpc1510 represent

Software test classification

Are the microorganisms in the intestines the same as those on the skin?

知识点滴 - PCB制造工艺流程

PCL .vtk文件与.pcd的相互转换

今日创见|企业促进创新的5大关键要素

面试百问:如何测试App性能?

小程序多种开发方式对比-跨端?低代码?原生?还是云开发?
随机推荐
Knowledge drop - PCB manufacturing process flow
[untitled] reprint melting ice - track icedid server with a few simple steps
GEE(三):计算两个波段间的相关系数与相应的p值
Understand the session, cookie and token at one time, and the interview questions are all finalized
V20变频器手自动切换(就地远程切换)的具体方法示例
De la famille debezium: SET ROLE statements supportant mysql8
关于海康ipc的几个参数
消息队列与快递柜之间妙不可言的关系
网络安全-钓鱼
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
QT graphicsview graphical view usage summary with flow chart development case prototype
Qt Graphicsview图形视图使用总结附流程图开发案例雏形
Some parameters of Haikang IPC
Guessing game (read data from file)
Interview questions: how to test app performance?
Ligne - raisonnement graphique - 4 - classe de lettres
Software test classification
2021-01-12
面试百问:如何测试App性能?
三菱PLC slmp(mc)协议