当前位置:网站首页>Get pictures through opencv, change channels and save them
Get pictures through opencv, change channels and save them
2022-07-07 10:49:00 【HCC2017】
#include<opencv2/opencv.hpp>
#include<iostream>
#include<math.h>
using namespace cv;
int main() {
Mat m = imread("C:/Users/Administrator/Desktop/2.jpg"); // Get photo imread("C:/Users/Administrator/Desktop/2.jpg",2); It can be obtained directly in the form of gray image
if (m.empty()) {
printf("could notload image...\n");
return -1;
}
namedWindow("test opencv setup", CV_WINDOW_AUTOSIZE); // Create a , Auto fit window
imshow("test opencv setup", m); // Display the loaded pictures
namedWindow("output windows", CV_WINDOW_AUTOSIZE);
Mat output_image;
cvtColor(m, output_image,CV_BGR2HLS); // Modify picture type
imshow("output windows", output_image);
//imwrite("D:/2.jpg", output_image); // Store the modified picture
waitKey(0);
return 0;
}
边栏推荐
- Network engineer test questions and answers in May of the first half of 2022
- Applet jump to H5, configure business domain name experience tutorial
- 2022.7.3DAY595
- ArrayList线程不安全和解决方案
- How embedded engineers improve work efficiency
- The width of table is 4PX larger than that of tbody
- 宁愿把简单的问题说一百遍,也不把复杂的问题做一遍
- Some superficial understanding of word2vec
- CC2530 ZigBee iar8.10.1 environment construction
- 【机器学习 03】拉格朗日乘子法
猜你喜欢

ADB utility commands (network package, log, tuning related)

Basic introduction of yarn and job submission process

Mendeley--免费的文献管理工具,给论文自动插入参考文献

Using U2 net deep network to realize -- certificate photo generation program

When do you usually get grades in the soft exam? Online pedaling?

【亲测可行】error while loading shared libraries的解决方案

What does intermediate software evaluator test

Network engineer test questions and answers in May of the first half of 2022

555 circuit details

深入理解Apache Hudi异步索引机制
随机推荐
【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
长列表性能优化方案 memo
MONAI版本更新到 0.9 啦,看看有什么新功能
单调性约束与反单调性约束的区别 monotonicity and anti-monotonicity constraint
枪出惊龙,众“锁”周之
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE
I'd rather say simple problems a hundred times than do complex problems once
Some online academic report websites and machine learning videos
[système recommandé 01] rechub
Network engineer test questions and answers in May of the first half of 2022
CC2530 zigbee IAR8.10.1环境搭建
简单易修改的弹框组件
What are the contents of the intermediate soft test, the software designer test, and the test outline?
BUUCTF---Reverse---reverse1
那些易混淆的概念(三):function和class
ArrayList线程不安全和解决方案
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
leetcode-304:二维区域和检索 - 矩阵不可变
1323: [example 6.5] activity selection
Deep understanding of Apache Hudi asynchronous indexing mechanism