当前位置:网站首页>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));
边栏推荐
- Circumvention Technology: Registry
- I wish you all the best and the year of the tiger
- Innovation today | five key elements for enterprises to promote innovation
- LeetCode144. Preorder traversal of binary tree
- Line test - graphic reasoning - 2 - black and white lattice class
- Line test graph reasoning graph group class
- Debezium series: set role statement supporting mysql8
- Handling file exceptions
- CTF exercise
- GEE(三):计算两个波段间的相关系数与相应的p值
猜你喜欢
Line test - graphic reasoning - 4 - alphabetic class
二叉树(Binary Tree)
LeetCode707. Design linked list
How to operate DTC community?
行测-图形推理-8-图群类
面试百问:如何测试App性能?
Comparison of various development methods of applets - cross end? Low code? Native? Or cloud development?
消息队列与快递柜之间妙不可言的关系
30讲 线性代数 第五讲 特征值与特征向量
不夸张地说,这是我见过最通俗易懂的,pytest入门基础教程
随机推荐
ArcGIS:矢量要素相同字段属性融合的两种方法
Unity dynamically merges mesh textures
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
网络安全-联合查询注入
网络安全-永恒之蓝
LeetCode142. Circular linked list II [two pointers, two methods for judging links in the linked list and finding ring points]
Database daily question --- day 22: last login
iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地
What is fake sharing after filling the previous hole?
ASEMI整流桥KBPC1510的型号数字代表什么
行测-图形推理-3-对称图形类
Sword finger offer 28 Symmetric binary tree
Early childhood education industry of "screwing bar": trillion market, difficult to be a giant
Txt file virus
7-18 simple simulation of banking business queue
Transparent i/o model from beginning to end
Knowledge drop - PCB manufacturing process flow
行测-图形推理-5-一笔画类
Introduction to anomaly detection
[untitled] reprint melting ice - track icedid server with a few simple steps