当前位置:网站首页>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;
}
边栏推荐
- Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
- leetcode-303:区域和检索 - 数组不可变
- Mendeley--免费的文献管理工具,给论文自动插入参考文献
- 施努卡:机器视觉定位技术 机器视觉定位原理
- Applet jump to H5, configure business domain name experience tutorial
- CAS mechanism
- The width of table is 4PX larger than that of tbody
- SQL Server 知识汇集11 : 约束
- Typescript interface inheritance
- China Southern Airlines pa3.1
猜你喜欢

2022年上半年5月网络工程师试题及答案

IO model review

Leetcode-304: two dimensional area and retrieval - matrix immutable

Using U2 net deep network to realize -- certificate photo generation program
![[recommendation system 01] rechub](/img/92/c14c867247d3a042c69b5ed0091fbe.png)
[recommendation system 01] rechub

Use load_ decathlon_ Datalist (Monai) fast loading JSON data

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

ArrayList线程不安全和解决方案

Multithreaded asynchronous orchestration

软考中级,软件设计师考试那些内容,考试大纲什么的?
随机推荐
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE
I'd rather say simple problems a hundred times than do complex problems once
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
Long list performance optimization scheme memo
Applet jump to H5, configure business domain name experience tutorial
2022年7月10日“五心公益”活动通知+报名入口(二维码)
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
[牛客网刷题 Day6] JZ27 二叉树的镜像
MONAI版本更新到 0.9 啦,看看有什么新功能
What are the contents of the intermediate soft test, the software designer test, and the test outline?
Jump to the mobile terminal page or PC terminal page according to the device information
Common shortcut keys in IDA
Simple and easy to modify spring frame components
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
String formatting
How to prepare for the advanced soft test (network planning designer)?
TypeScript 接口继承
【推薦系統 01】Rechub
IDA中常见快捷键
ThreadLocal会用可不够