clc;
clear all;
close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread('4.jpg');
I=double(I);
Image=I/255; xScale = 20;
yScale = 20;
amount = 1;
turbulence =0.25; Image_new=Image; [height, width, depth]=size(Image); Index=1:256;
sin_T=-yScale*sin(2*pi*(Index-1)/256*turbulence);
cos_T=xScale*cos(2*pi*(Index-1)/256*turbulence); [ind, g1, g2, g3]=init_arr(); for ii=1:height % % [ind, g1, g2, g3]=init_arr(); for jj=1:width dis=min(max( floor(127*(1+Noise2(jj/xScale, ii/yScale, ind, g2))), 1), 256); x=jj+sin_T(dis);
y=ii+cos_T(dis); % % if (x<=1) x=1; end
% % if (x>=width) x=width-1; end;
% % if (y>=height) y=height-1; end;
% % if (y<1) y=1; end;
% % if (x<=1) continue; end
if (x>=width) continue; end;
if (y>=height) continue; end;
if (y<1) continue; end; x1=floor(x);
y1=floor(y);
p=x-x1;
q=y-y1; Image_new(ii,jj,:)=(1-p)*(1-q)*Image(y1,x1,:)+p*(1-q)*Image(y1,x1+1,:)...
+q*(1-p)*Image(y1+1,x1,:)+p*q*Image(y1+1,x1+1,:);
end
end imshow(Image_new)
imwrite(Image_new, 'out.jpg');

参考来源:http://www.jhlabs.com/index.html

原图:

效果图:

PS 滤镜— —Marble 效果的更多相关文章

  1. Python: PS 滤镜--万花筒效果

    本文用 Python 实现 PS 的一种滤镜效果,称为万花筒.也是对图像做各种扭曲变换,最后图像呈现的效果就像从万花筒中看到的一样: 图像的效果可以参考之前的博客: http://blog.csdn. ...

  2. PS 滤镜— —挤压效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  3. PS 滤镜— — 万花筒效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  4. PS 滤镜— —水波效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  5. PS 滤镜— — sparkle 效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  6. PS 滤镜— —球面化效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  7. PS滤镜— —波浪效果

    clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...

  8. OpenCV——PS滤镜 水波效果

    // define head function #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ALGORITHM_H_INCLUDED #include < ...

  9. Python: PS 滤镜特效 -- Marble Filter

    本文用 Python 实现 PS 滤镜特效,Marble Filter, 这种滤镜使图像产生不规则的扭曲,看起来像某种玻璃条纹, 具体的代码如下: import numpy as np import ...

随机推荐

  1. Android 下拉刷新上拉载入 多种应用场景 超级大放送(上)

    转载请标明原文地址:http://blog.csdn.net/yalinfendou/article/details/47707017 关于Android下拉刷新上拉载入,网上的Demo太多太多了,这 ...

  2. 实用T-SQL代码

    1.根据出生日期计算当前已满周岁 DECLARE @birth datetime SET @birth='1990-01-01' ),) ),) 2.COUNT(expression) just re ...

  3. Q: Why can't I access the Site Settings of my SharePoint site? 'File Not Found'

    Q: I am trying to access the Site Settings of my SharePoint site, but I get a File Not Found error, ...

  4. 【BZOJ3112】[Zjoi2013]防守战线 单纯形法

    [BZOJ3112][Zjoi2013]防守战线 题解:依旧是转化成对偶问题,然后敲板子就行了~ 建完表后发现跟志愿者招募的表正好是相反的,感觉很神奇~ #include <cstdio> ...

  5. RMQ with Shifts(线段树)

    RMQ with Shifts Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:%I64d & %I64u Pra ...

  6. ElasticSearch(二十七)type的数据结构

    1.什么是type? type,是一个index中用来区分类似的数据的,类似的数据,但是可能有不同的fields,而且有不同的属性来控制索引建立.分词器field的value,在底层的lucene中建 ...

  7. SocketAsyncEventArgs里的AcceptSocket能独立存在吗?

    独立存在是什么意思? 先来看一个例子.我们知道一个Socket对象(我们叫他ListenScoket)可以调用AcceptAsync并接受一个SocketAsyncEventArgs对象,如果操作成功 ...

  8. Android代码绘制虚线、圆角、渐变效果图

    drawable文件夹放置动画/形状/选择器等属性文件,唯一的drawable文件名,不允许写错和拼错,否则运行报错.drawable文件夹底下的xml文件可以包括的标签共18个:animation- ...

  9. Linux安装samba

    说明:samba的作用是实现window环境和linux环境下的文件共享,相当于window里的网络邻居,有一定的价值,但是随着时代的发展,现在用各种ssh软件登录linux实现文件共享和传输的场景越 ...

  10. 有关numpy.random下的API具体含义

    1.numpy.random.random(size=None) Return random floats in the half-open interval [0.0, 1.0). 返回size大小 ...