当前位置:网站首页>Opencv learning notes - loading and saving images
Opencv learning notes - loading and saving images
2022-06-24 12:05:00 【cc_ rong】
Catalog
Image loading :imread() function
Image saving :imwrite() function
Image loading :imread() function
Mat imread(const string& filename, int flags = IMREAD_COLOR )Parameter one : The name of the image
Parameter two : Read tag , Used to select how to read pictures , The default value is IMREAD_COLOR,flag The setting of the value is related to the color format used to read the picture .
IMREAD_COLOR: Always read three channel images
IMREAD_GRAYSCALE: Always read single channel
IMREAD_ANYCOLOR: The number of channels is determined by the actual number of channels in the file ( No more than 3)
IMREAD_ANYDEPTH: Allow loading more than 8bit depth
IMREAD_UNCHANGED: ( When reading an image , Keep in image alpha passageway )
Image format types are supported ;
Image saving :imwrite() function
bool imwrite(const string& filename,
InputArray image,
const vector<int>& params = vector<int>())Parameter one : Save the given file name , Extension :
jpg perhaps jpeg、jp2、tif or tiff、png( Recommended )、bmp、ppm、pgm
Parameter two : Stored input image .
Parameter 3 : Data required for writing to a special type of file
Code
// Read images Mat image = imread("1.jpg"); // Judge whether the reading is successful if(image.data == NULL) { return ; } // Show imshow("readImg", image); // Save image if(!imwrite("1To2.jpg", image)) { return ; }
边栏推荐
- u盘安装kali并且持久化
- 美团基于 Flink 的实时数仓平台建设新进展
- 程序员大部分时间不是写代码,而是。。。
- [the lottery in May has ended, and the list of winners has been announced] special session of techo youth university open course database
- 11+! 结肠癌中基于 m6A 调节因子的甲基化修饰模式以不同的肿瘤微环境免疫谱为特征
- Audio knowledge (III) -- MFCCs code implementation
- Opencv optical flow prediction and remap remapping function usage
- 12+!不同癌症中TMB与ICI反应之间的免疫相关因素研究
- 如何开发短信通知和语音功能医院信息系统(HIS系统)
- How does wechat and QQ chat work? So simple!!!
猜你喜欢

Turn 2D photos into 3D models to see NVIDIA's new AI "magic"!

计组-总复习

qt -- QTabWidget 中支持拖拽TabBar项

Insurance app aging service evaluation analysis 2022 issue 06

Group planning - General Review

u盘安装kali并且持久化

Qt: 判断字符串是否为数字格式

Linker --- linker
![[live review] battle code pioneer phase 7: how third-party application developers contribute to open source](/img/fa/e52bd8a1a404a759ef6ba88e8da0f0.png)
[live review] battle code pioneer phase 7: how third-party application developers contribute to open source

软件测试 对前一日函数的基本路径测试
随机推荐
qt -- QTabWidget 中支持拖拽TabBar项
It's so difficult for me. Have you met these interview questions?
怎样申请打新债 开户是安全的吗
Realization of alarm clock with AHK
Nacos source code - configure automatic update
Anonymous Messenger: hidden communication of Trojan horse
Speculation London gold short-term stable money making skills? Where is it safe to fry London gold?
[digital ic/fpga] booth multiplier
【直播回顾】战码先锋第七期:三方应用开发者如何为开源做贡献
11+! 结肠癌中基于 m6A 调节因子的甲基化修饰模式以不同的肿瘤微环境免疫谱为特征
How to develop hospital information system (his) with SMS notification and voice function
Influence of DEX optimization on arouter lookup path
A fault record of misoperation dhclient script
Opencv optical flow prediction and remap remapping function usage
LS-DYNA beginner's experience
万名校园开发者花式玩AI,亮点看这张图就够啦!
【老卫搞机】090期:键盘?主机?全功能键盘主机!
《梦华录》要大结局了,看超前点映不如先来学学它!
《opencv学习笔记》-- 分离颜色通道、多通道混合
Variable parameter template implements max (accepts multiple parameters, two implementation methods)
