当前位置:网站首页>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));
边栏推荐
- This time, let's clear up: synchronous, asynchronous, blocking, non blocking
- 网络安全-钓鱼
- Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
- 消息队列与快递柜之间妙不可言的关系
- QT graphicsview graphical view usage summary with flow chart development case prototype
- Comparison of various development methods of applets - cross end? Low code? Native? Or cloud development?
- 行测-图形推理-4-字母类
- Ligne - raisonnement graphique - 4 - classe de lettres
- Classification and prediction of heartbeat signal
- 嵌入式音频开发中的两种曲线
猜你喜欢

Microbial health network, how to restore microbial communities

Unity and webgl love each other

Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors

DTC社群运营怎么做?
![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

Unity与WebGL的相爱相杀

Understand the session, cookie and token at one time, and the interview questions are all finalized

Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
随机推荐
Anta DTC | Anta transformation, building a growth flywheel that is not only FILA
消息队列与快递柜之间妙不可言的关系
2021-01-11
[network] Introduction to C language
网络安全-sqlmap与DVWA爆破
Unity dynamically merges mesh textures
About idea cannot find or load the main class
网络安全-联合查询注入
网络安全-CSRF
Debezium系列之:支持 mysql8 的 set role 語句
网络安全-burpsuit
CTF exercise
Unity and webgl love each other
Line test - graphic reasoning -7- different graphic classes
Locate to the bottom [easy to understand]
行测-图形推理-5-一笔画类
[record of question brushing] 3 Longest substring without duplicate characters
U盘拷贝东西时,报错卷错误,请运行chkdsk
Innovation today | five key elements for enterprises to promote innovation
Brush question 6