OpenCV——高斯模糊与毛玻璃特效
2015-09-13 13:38
405 查看
// define head function #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ALGORITHM_H_INCLUDED #include <iostream> #include <string> #include "cv.h" #include "highgui.h" #include "cxmat.hpp" #include "cxcore.hpp" #include "math.h" using namespace std; using namespace cv; void Show_Image(Mat&, const string &); #endif // PS_ALGORITHM_H_INCLUDED /* This program will generate gaussian blur and glass effect */ #include "PS_Algorithm.h" #include <time.h> using namespace std; using namespace cv; int main() { string Img_name("9.jpg"); Mat Img_in; Img_in=imread(Img_name); Show_Image(Img_in, Img_name); Mat Img_out(Img_in.size(), CV_32FC3); Img_in.convertTo(Img_out, CV_32FC3); Mat temp; temp=Img_out.rowRange(100, 300); cv::GaussianBlur(temp, temp, Size(21,21), 0, 0); cv::GaussianBlur(temp, temp, Size(21,21), 0, 0); Img_out=Img_out/255.0; Show_Image(Img_out, "out"); imwrite("Out.jpg", Img_out*255); waitKey(); } // define the show image #include "PS_Algorithm.h" #include <iostream> #include <string> using namespace std; using namespace cv; void Show_Image(Mat& Image, const string& str) { namedWindow(str.c_str(),CV_WINDOW_AUTOSIZE); imshow(str.c_str(), Image); }
原图
效果图
相关文章推荐
- web hosting上opencart发送邮件问题解决方法
- Dop中的sop solver
- 从RealSense中提取完整的深度和彩色图像,并存在opencv中的Mat里
- Linux内核编程的特点
- Nginx学习笔记一_UNIX中的IO模型
- Unbuntu12.04 x64 安装jdk-7u45-linux-x64.tar.gz
- 反向代理是什么,有什么特点
- Linux之fork函数
- [原创]opencv图像亮度/对比度调整实验
- linux free命令用法以及解释
- CentOS7中文输入法,拼音输入法
- Shell: nohup守护进程化
- Nginx Location配置总结
- bash shell数组
- 虚拟机安装 centos7 注意事项
- 用花生壳怎样发布网站
- PX4源码开发人员文档(一)——软件架构
- linux shell — 1.命令的执行方式、man page 和关机
- linux软RAID
- 门户网站