老照片
来源:互联网 发布:淘宝众筹买东西靠谱吗 编辑:程序博客网 时间:2024/04/29 16:22
#include<opencv2\opencv.hpp>#include<core\core.hpp>#include<highgui\highgui.hpp>using namespace cv;using namespace std;int main() {Mat img = imread("D://图片//5.jpg");if (!img.data)return -1;img.convertTo(img, CV_32F);Mat result = img.clone();for (int i = 0; i < img.rows; i++) {float *p = img.ptr<float>(i);float *n = result.ptr<float>(i);for (int j = 0; j < img.cols; j++) {n[j * 3 + 0] = p[j * 3 + 0] * 0.131 + p[j * 3 + 1] * 0.534 + p[j * 3 + 2] * 0.272;n[j * 3 + 1] = p[j * 3 + 0] * 0.168 + p[j * 3 + 1] * 0.686 + p[j * 3 + 2] * 0.349; n[j * 3 + 2] = p[j * 3 + 0] * 0.189 + p[j * 3 + 1] * 0.769 + p[j * 3 + 2] * 0.393;}}result.convertTo(result, CV_8U);imshow("result", result);waitKey(0);destroyAllWindows;return 0;}
效果:
0 0
- 老照片
- 老照片
- 老照片
- 再贴2004老照片
- 费佩德的老照片
- 老照片修复(photoshop)
- 一组老照片
- 烟台老照片-1
- 烟台老照片-2
- 一组老照片的解读
- 乔帮主的老照片
- xcode老版本 照片问题
- 【ps】修复老照片思路
- 图像特效之老照片
- photoshop修复老照片方法
- 迈克尔·杰克逊-老照片
- 一张老照片上看故乡内江
- Learning ImageMagick 3: 老照片效果
- hdu2795Billboard
- Netbeans8.1 IDE的插件和历史记录(二)
- 算法系列(八)数据结构之二叉查找树
- Delete Node in a Linked List
- ACM:蓝桥杯:韩信点兵
- 老照片
- ACM:蓝桥杯:水仙花数
- 2实验吧逆向
- 进程与线程关系
- json解读以及Gson的使用
- ITQ(Iterative Quantization)迭代量化方法详解 hash 哈希算法
- 系统启动 之 Linux系统启动概述(1)
- 关于mysql的安装、配置及更改密码需注意的问题
- HDU 1595 find the longest of the shortest (Dijkstra算法)