当前位置:网站首页>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));
边栏推荐
- DTC社群运营怎么做?
- 行测-图形推理-6-相似图形类
- Some parameters of Haikang IPC
- Database daily question --- day 22: last login
- Line test - graphic reasoning -7- different graphic classes
- QT graphicsview graphical view usage summary with flow chart development case prototype
- Qt Graphicsview图形视图使用总结附流程图开发案例雏形
- Byte hexadecimal binary understanding
- iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地
- Sword finger offer 55 - I. depth of binary tree
猜你喜欢
![Leetcode interview question 02.07 Linked list intersection [double pointer]](/img/a5/58b4735cd0e47f1417ac151a1bcca4.jpg)
Leetcode interview question 02.07 Linked list intersection [double pointer]

微信论坛交流小程序系统毕业设计毕设(5)任务书

Two minutes, talk about some wrong understandings of MySQL index

Line test - graphic reasoning - 6 - similar graphic classes

Unity与WebGL的相爱相杀

Microbial Health Network, How to restore Microbial Communities

微信论坛交流小程序系统毕业设计毕设(2)小程序功能

Software test classification

微信论坛交流小程序系统毕业设计毕设(4)开题报告

What is fake sharing after filling the previous hole?
随机推荐
Knowledge drop - PCB manufacturing process flow
Develop those things: go plus c.free to free memory, and what are the reasons for compilation errors?
7-18 simple simulation of banking business queue
Cause analysis and solution of too laggy page of [test interview questions]
Two minutes, talk about some wrong understandings of MySQL index
DTC社群运营怎么做?
Anta DTC | Anta transformation, building a growth flywheel that is not only FILA
Talk about DART's null safety feature
肠道里的微生物和皮肤上的一样吗?
Classification and prediction of heartbeat signal
2021-01-11
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
What does the model number of asemi rectifier bridge kbpc1510 represent
网络安全-CSRF
Line test - graphic reasoning - 6 - similar graphic classes
开发那些事儿:Go加C.free释放内存,编译报错是什么原因?
Advantages and disadvantages of rest ful API
Years of summary, some core suggestions for learning programming
U盘拷贝东西时,报错卷错误,请运行chkdsk
Brush question 6