当前位置:网站首页>Opencv scalar passes in three parameters, which can only be displayed in black, white and gray. Solve the problem
Opencv scalar passes in three parameters, which can only be displayed in black, white and gray. Solve the problem
2022-07-07 23:15:00 【Wang Bai ~】
The error code is :
cv::Mat img2(h, w, CV_8UC1, cv::Scalar(0, 255, 0));
scalar The three parameters passed in are BGR, The above function I want to generate is a green picture , However, what is actually produced is white .
The problem lies in the third parameter , Parameter is CV_8UC1 It means that the black-and-white gray pattern is generated . You need to change the parameter to CV_8UC3, This time can produce the correct results .
cv::Mat img2(h, w, CV_8UC3, cv::Scalar(0, 255, 0));
边栏推荐
- 网络安全-CSRF
- ArcGIS: two methods of attribute fusion of the same field of vector elements
- I wish you all the best and the year of the tiger
- U盘拷贝东西时,报错卷错误,请运行chkdsk
- 智慧社區和智慧城市之間有什麼异同
- Why does the market need low code?
- Byte hexadecimal binary understanding
- Talk about the design and implementation logic of payment process
- Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
- Specific method example of V20 frequency converter manual automatic switching (local remote switching)
猜你喜欢
Gee (IV): calculate the correlation between two variables (images) and draw a scatter diagram
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
高级程序员必知必会,一文详解MySQL主从同步原理,推荐收藏
Database daily question --- day 22: last login
[microservices SCG] gateway integration Sentinel
十四、数据库的导出和导入的两种方法
海内外技术人们“看”音视频技术的未来
聊聊 Dart 的空安全 (null safety) 特性
UE4_UE5蓝图command节点的使用(开启关闭屏幕响应-log-发布全屏显示)
Brush question 3
随机推荐
聊聊支付流程的设计与实现逻辑
GEE(四):计算两个变量(影像)之间的相关性并绘制散点图
Txt file virus
UE4_UE5蓝图command节点的使用(开启关闭屏幕响应-log-发布全屏显示)
Dynamics 365 查找字段过滤
Dynamics 365 find field filtering
成年人只有一份主业是要付出代价的,被人事劝退后,我哭了一整晚
Wechat forum exchange applet system graduation design completion (1) development outline
Specific method example of V20 frequency converter manual automatic switching (local remote switching)
Txt file virus
2021-01-12
Clean C disk
USB (十七)2022-04-15
Brush question 3
QT graphicsview graphical view usage summary with flow chart development case prototype
嵌入式音频开发中的两种曲线
Grid
The wonderful relationship between message queue and express cabinet
Wechat forum exchange applet system graduation design completion (8) graduation design thesis template
Wechat forum exchange applet system graduation design (3) background function