当前位置:网站首页>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;
}
边栏推荐
- Simple and easy to modify spring frame components
- 枪出惊龙,众“锁”周之
- 中级软件评测师考什么
- 想考中级软考,一般需要多少复习时间?
- 2022.7.3DAY595
- [actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
- What are the test preparation materials and methods for soft exam information processing technicians?
- 宁愿把简单的问题说一百遍,也不把复杂的问题做一遍
- Schnuka: working principle of robot visual grasping machine visual grasping
- Schnuka: machine vision positioning technology machine vision positioning principle
猜你喜欢

Summary of router development knowledge

【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘

打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?

使用 load_decathlon_datalist (MONAI)快速加载JSON数据

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

深入理解Apache Hudi异步索引机制

软考中级,软件设计师考试那些内容,考试大纲什么的?

2022年7月10日“五心公益”活动通知+报名入口(二维码)

CAS mechanism

【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE
随机推荐
Leetcode-560: subarray with sum K
Trajectory planning for multi-robot systems: Methods and applications 综述阅读笔记
IIC Basics
Multithreaded asynchronous orchestration
JS implementation chain call
ThreadLocal is not enough
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
枪出惊龙,众“锁”周之
单调性约束与反单调性约束的区别 monotonicity and anti-monotonicity constraint
CAS mechanism
高级软考(网络规划设计师)该如何备考?
Summary of router development knowledge
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
How to successfully pass the senior system architecture designer in the second half of the year?
String formatting
【推荐系统 01】Rechub
單調性約束與反單調性約束的區別 monotonicity and anti-monotonicity constraint
关于easyflash v3.3使用过程的记录
多线程-异步编排
What are the test preparation materials and methods for soft exam information processing technicians?