PS 滤镜— — sparkle 效果
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
原图:
效果图:
PS 滤镜— — sparkle 效果的更多相关文章
- Python: PS 滤镜--万花筒效果
本文用 Python 实现 PS 的一种滤镜效果,称为万花筒.也是对图像做各种扭曲变换,最后图像呈现的效果就像从万花筒中看到的一样: 图像的效果可以参考之前的博客: http://blog.csdn. ...
- PS 滤镜— —挤压效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- PS 滤镜— —Marble 效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- PS 滤镜— — 万花筒效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- PS 滤镜— —水波效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- PS 滤镜— —球面化效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- PS滤镜— —波浪效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...
- OpenCV——PS滤镜 水波效果
// define head function #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ALGORITHM_H_INCLUDED #include < ...
- Python: PS 滤镜--旋涡特效
本文用Python 实现 PS 滤镜的旋涡特效,具体的算法原理和效果可以参考之前的博客: http://blog.csdn.net/matrix_space/article/details/42215 ...
随机推荐
- maven打包时无法加载lib下的jar
© 版权声明:本文为博主原创文章,转载请注明出处 问题描述: 项目在本地部署没有问题,但是使用maven打包时报错: ***(引用jar中某个类的的路径) 不存在 ***(某个java类中的某行某列) ...
- Spring学习十二----------Bean的配置之@ImportResource和@Value
© 版权声明:本文为博主原创文章,转载请注明出处 @ImportResource -引入XML配置文件 @Value -从配置文件中获取值 实例 1.项目结构 2.pom.xml <projec ...
- Chrome自带恐龙小游戏的源码研究(完)
在上一篇<Chrome自带恐龙小游戏的源码研究(七)>中研究了恐龙与障碍物的碰撞检测,这一篇主要研究组成游戏的其它要素. 游戏分数记录 如图所示,分数及最高分记录显示在游戏界面的右上角,每 ...
- ip获取位置
$ip = $_SERVER["REMOTE_ADDR"]; $url = "http://ip.taobao.com/service/getIpInfo.php?ip= ...
- Erlang节点重启导致的incarnation问题(转)
转自霸爷的博客: 转载自系统技术非业余研究 本文链接地址: Erlang节点重启导致的incarnation问题 遇到个问题, =ERROR REPORT==== 10-Mar-2016::09:44 ...
- WPF的ListView控件自定义布局用法实例
正文: 如何布局是在App.xaml中定义源码如下 <Application x:Class="CWebsSynAssistant.App" xmlns="ht ...
- 漫反射和Lambert模型
粗糙的物体表面向各个方向等强度地反射光,这种等同地向各个方向散射的现象称为光的漫反射(diffuse reflection).产生光的漫反射现象的物体表面称为理想漫反射体,也称为朗伯(Lambert) ...
- spring AOP(切面)
AOP 基本概念cross cutting concern横切性关注点:独立服务,遍布在系统处理流程之中 Aspect对横切关注点模块化 advice对横切关注点具体实现 pointcut定义adv ...
- EntityFramework走马观花之CRUD(下)
我在Entity Framework系列文章的CRUD上篇中介绍了EF的数据查询,中篇谈到了EF的数据更新,下篇则聊聊EF实现CRUD的内部原理. 跟踪实体对象状态 在CRUD上篇和中篇谈到,为了实现 ...
- linux install beanstalkd
you can instal it via git and then copy systemd script: Step 0. Install git yum install git Step 1. ...