当前位置:网站首页>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));
边栏推荐
- Unity and webgl love each other
- Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
- CTF exercise
- JMeter-接口自动化测试读取用例,执行并结果回写
- 一次搞明白 Session、Cookie、Token,面试问题全稿定
- 网络安全-burpsuit
- Software evaluation center ▏ what are the basic processes and precautions for automated testing?
- 网络安全-beef
- Are the microorganisms in the intestines the same as those on the skin?
- 微信论坛交流小程序系统毕业设计毕设(6)开题答辩PPT
猜你喜欢

ArcGIS:字段赋值_属性表字段计算器(Field Calculator)依据条件为字段赋值

Online interview, how to better express yourself? In this way, the passing rate will be increased by 50%~

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

Talk about DART's null safety feature

Sword finger offer 28 Symmetric binary tree

iNFTnews | Web5 vs Web3:未来是一个过程,而不是目的地

微信论坛交流小程序系统毕业设计毕设(1)开发概要

【测试面试题】页面很卡的原因分析及解决方案

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

DTC社群运营怎么做?
随机推荐
LeetCode144. Preorder traversal of binary tree
GEE(三):计算两个波段间的相关系数与相应的p值
GBU1510-ASEMI电源专用15A整流桥GBU1510
[language programming] exe virus code example
Debezium series: support the use of variables in the Kill Command
Line test - graphic reasoning - 4 - alphabetic class
Software test classification
Line test - graphic reasoning -7- different graphic classes
Class implementation of linear stack and linear queue (another binary tree pointer version)
Txt file virus
Microbial health network, how to restore microbial communities
微生物健康網,如何恢複微生物群落
There is another problem just online... Warm
ArcGIS:矢量要素相同字段属性融合的两种方法
Introduction to anomaly detection
Develop those things: go plus c.free to free memory, and what are the reasons for compilation errors?
Unity dynamically merges mesh textures
Sword finger offer 28 Symmetric binary tree
DTC社群运营怎么做?
Leetcode interview question 02.07 Linked list intersection [double pointer]