读入,修改和保存一幅图像_C++
来源:互联网 发布:mac 视频转码工具 编辑:程序博客网 时间:2024/06/05 17:40
接上一篇
#include "cv.h"#include "highgui.h"using namespace cv;using namespace std;int main(int argc,char *argv[]){Mat src,gray;src=imread("lena.jpg",CV_LOAD_IMAGE_COLOR);if (!src.data){cout<<"Cound not read the file!"<<endl;getchar();return -1;}cvtColor(src,gray,CV_RGB2GRAY);imwrite("../gray.jpg",gray); //其中../表示工程文件的上一级文件夹namedWindow("src");namedWindow("gray");imshow("src",src);imshow("gray",gray);waitKey(0);return 0;}
从中看到C++编程的方便性,在图像处理时,不用先创建图像空间
The functions can read/write images in the following formats:(格式支持)
BMP (.bmp), JPEG (.jpg, .jpeg), TIFF (.tif, .ti ), PNG(.png), PBM/PGM/PPM (.p?m), Sun Raster (.sr),JPEG 2000 (.jp2). Every format supports 8-bit, 1- or3-channel images. Some formats (PNG, JPEG 2000) support 16 bits per channel.
0 0
- 读入,修改和保存一幅图像_C++
- 读入与显示一副图像_C++
- 【OpenCV学习笔记】【函数学习】十一(读入图像﹑显示图像和保存图像)
- opecv-图像加载,修改和保存
- 利用OpenCV读入,显示并保存图像
- opencv-python(1):读入、显示、保存图像
- #R语言#读入和保存
- 读入并显示一幅图像—system generator
- 图片保存和数据读入保存方法
- opencv读入图像和avi
- 读取、修改、保存图像
- (九)数据读入和保存
- 读取、修改、保存图像---opencv
- OpenCV01_加载、修改、保存图像
- OpenCV 读取、修改、保存图像
- [Visual C++](一)VC保存和显示数据库图像(BMP)
- (一)VC保存和显示数据库图像(BMP)
- openCV-Python笔记一:图像的读取、显示和保存
- JSF使用icefaces标签<ui:insert>,<ui:include>,<ui:composition>
- 程序员生存定律-公司选择上的方法论
- InnoDB性能调优基础(进阶)
- C#中类的访问级别
- POJ 3670 && POJ 3671 (dp)
- 读入,修改和保存一幅图像_C++
- mac os恢复jdk1.6的办法
- 字典树hdu1075
- java 文件操作
- android弹出提示框AlertDialog的属性设置
- 采用linux下java http实现下载功能
- OC属性与内存管理(二),初学者必看
- getWritableDatabase()和getReadableDatabase()方法区别
- Mac OS下安装 lxml报错