PS 滤镜— — sparkle 效果
来源:互联网 发布:淘宝外星伴侣 正品吗 编辑:程序博客网 时间:2024/04/29 13:55
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread('4.jpg'); Image=double(I)/255; [height, width, depth]=size(Image); rays = 25; radius = 25; amount = 25; % 1-100 color = [1.0, 1.0, 1.0]; % 0-1 randomness = 25; centreX=width/2.0; centreY=height/2.0; % % seed = 371; rayLengths=radius+randomness / 100.0 * radius * rand(1,rays); Img_new=Image; for ii=1:height for jj=1:width dx = jj-centreX; dy = ii-centreY; distance=sqrt(dx*dx+dy*dy); angle = atan2(dy, dx); d = (angle+pi) / (2*pi) * rays; f=d-floor(d); len_1=rayLengths(mod(floor(d), rays)+1); len_2=rayLengths(mod(floor(d)+1, rays)+1); length = lerp(f, len_1, len_2); g = length*length / (distance+0.0001); g = g.^((100-amount) / 50.0); f =f - 0.5; % % f = 1-f*f; f =f * cos(g); % % f =f * sin(g); f=min(max(0,f),1); r=Image(ii, jj, 1); g=Image(ii, jj, 2); b=Image(ii, jj, 3); Img_new(ii, jj, 1)=lerp(f, r, color(1)); Img_new(ii, jj, 2)=lerp(f, g, color(2)); Img_new(ii, jj, 3)=lerp(f, b, color(3)); end end imshow(Img_new); imwrite(Img_new, 'out.jpg');
参考来源:http://www.jhlabs.com/index.html
原图:
效果图:
0 0
- PS 滤镜— — sparkle 效果
- OpenCV——PS 滤镜, 浮雕效果
- OpenCV——PS滤镜 水波效果
- PS 滤镜— —水波效果
- PS 滤镜— —挤压效果
- PS 滤镜— —Marble 效果
- PS 滤镜— — 万花筒效果
- PS滤镜— —波浪效果
- PS 滤镜— —球面化效果
- PS 滤镜算法原理——碎片效果
- PS 滤镜算法原理——浮雕效果
- PS 滤镜——扩散特效, 毛玻璃 效果
- OpenCV——PS滤镜之 波浪效果 wave
- PS 滤镜——Skewing
- Python: PS 滤镜--万花筒效果
- PS 滤镜——(扭曲)逆球面化 (凹陷效果)
- OpenCV——PS滤镜算法之Spherize 球面化(凸出效果)
- OpenCV——PS滤镜算法之 球面化 (凹陷效果)
- hadoop1.2.1报Warning: $HADOOP_HOME is deprecated. 的解决方法
- 【MyBatis框架】SqlMapConfigl配置文件之常用的setting设置
- 机器学习和统计模型的差异
- 用Redis作为Mysql数据库的缓存(-)
- Step into Kotlin - 14 - 继承
- PS 滤镜— — sparkle 效果
- vsftpd移植到arm问题
- 怎么阅读论文,写心得体会
- 数据结构基础 之 二叉堆实现堆排序
- 获取某一文件夹下特别创建时间以后的文件
- apache+svn服务搭建
- eclipse中在线安装FindBugs
- RB树
- 用Redis作为Mysql数据库的缓存(二)