当前位置:网站首页>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));
边栏推荐
- 一次搞明白 Session、Cookie、Token,面试问题全稿定
- Exploratory data analysis of heartbeat signal
- 微信论坛交流小程序系统毕业设计毕设(7)中期检查报告
- Leetcode19. Delete the penultimate node of the linked list [double pointer]
- kubernetes的简单化数据存储StorageClass(建立和删除以及初步使用)
- Debezium series: binlogreader for source code reading
- Qt Graphicsview图形视图使用总结附流程图开发案例雏形
- 网络安全-sqlmap与DVWA爆破
- 安踏DTC | 安踏转型,构建不只有FILA的增长飞轮
- Unity and webgl love each other
猜你喜欢
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
JMeter-接口自动化测试读取用例,执行并结果回写
Line test - graphic reasoning - 4 - alphabetic class
Online interview, how to better express yourself? In this way, the passing rate will be increased by 50%~
行测-图形推理-7-相异图形类
Brush question 3
Transform XL translation
Leetcode19. Delete the penultimate node of the linked list [double pointer]
行测-图形推理-2-黑白格类
Leetcode94. Middle order traversal of binary trees
随机推荐
Early childhood education industry of "screwing bar": trillion market, difficult to be a giant
LeetCode203. Remove linked list elements
Unity 动态合并网格纹理
Line test - graphic reasoning -5- one stroke class
微信论坛交流小程序系统毕业设计毕设(1)开发概要
网络安全-钓鱼
GBU1510-ASEMI电源专用15A整流桥GBU1510
Unity与WebGL的相爱相杀
There is another problem just online... Warm
微生物健康网,如何恢复微生物群落
Clean C disk
行测-图形推理-7-相异图形类
行测-图形推理-4-字母类
开发那些事儿:Go加C.free释放内存,编译报错是什么原因?
Qt Graphicsview图形视图使用总结附流程图开发案例雏形
网络安全-CSRF
What does the model number of asemi rectifier bridge kbpc1510 represent
微信论坛交流小程序系统毕业设计毕设(8)毕业设计论文模板
ASEMI整流桥KBPC1510的型号数字代表什么
Years of summary, some core suggestions for learning programming