当前位置:网站首页>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;
}
边栏推荐
- PHP \ newline cannot be output
- “梦想杯”2017 年江苏省信息与未来小学生夏令营 IT 小能手 PK 之程序设计试题
- 深入理解Apache Hudi异步索引机制
- 5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!
- Installation and configuration of slurm resource management and job scheduling system
- [homework] 2022.7.6 write your own cal function
- BUUCTF---Reverse---reverse1
- I'd rather say simple problems a hundred times than do complex problems once
- gym安装踩坑记录
- 【作业】2022.7.6 写一个自己的cal函数
猜你喜欢

CSAPP bomb lab parsing

The difference between monotonicity constraint and anti monotonicity constraint

原型与原型链

优雅的 Controller 层代码

Multithreaded asynchronous orchestration

Deep understanding of Apache Hudi asynchronous indexing mechanism

【OneNote】无法连接到网络,无法同步问题

SQL Server knowledge gathering 9: modifying data
![[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树](/img/ba/b2dfbf121798757c7b9fba4811221b.png)
[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树

單調性約束與反單調性約束的區別 monotonicity and anti-monotonicity constraint
随机推荐
优雅的 Controller 层代码
BUUCTF---Reverse---reverse1
TypeScript 接口继承
[pro test feasible] error while loading shared libraries solution
Mendeley -- a free document management tool that automatically inserts references into papers
【亲测可行】error while loading shared libraries的解决方案
2021 summary and 2022 outlook
openinstall与虎扑达成合作,挖掘体育文化产业数据价值
[pytorch 07] hands on deep learning chapter_ Preliminaries/ndarray exercises hands-on version
Using U2 net deep network to realize -- certificate photo generation program
[homework] 2022.7.6 write your own cal function
Leetcode-304: two dimensional area and retrieval - matrix immutable
如何顺利通过下半年的高级系统架构设计师?
施努卡:机器视觉定位技术 机器视觉定位原理
5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
CAS mechanism
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树
SQL Server knowledge gathering 9: modifying data