Edge-Avoiding Wavelets and their Applications

Raanan Fattal

   
 

Abstract

We propose a new family of second-generation wavelets constructed using a robust data-prediction lifting scheme. The support of these new wavelets is constructed based on the edge content of the image and avoids having pixels from both sides of an edge. Multi-resolution analysis, based on these new edge-avoiding wavelets, shows a better decorrelation of the data compared to common linear translation-invariant multi-resolution analyses. The reduced inter-scale correlation allows us to avoid halo artifacts in band-independent multi-scale processing without taking any special precautions. We thus achieve nonlinear data-dependent multi-scale edge-preserving image filtering and processing at computation times which are linear in the number of image pixels. The new wavelets encode, in their shape, the smoothness information of the image at every scale. We use this to derive a new edge-aware interpolation scheme that achieves results, previously computed by an inhomogeneous Laplace equation, through an explicit computation. We thus avoid the difficulties in solving large and poorly-conditioned systems of equations.

We demonstrate the effectiveness of the new wavelet basis for various computational photography applications such as multi-scale dynamic-range compression, edge-preserving smoothing and detail enhancement, and image colorization.

 

This methodology is licensed by Adobe and used in the recentPhotoshop CS5 in a feature called `Protect Details.' A video demonstrating that can be foundhere.

  

 

Links:

  • manuscript,sup ma and aNEW note about HDR compression
  • Results page, see NEWresults about HDR compression
  • A note by by Eric Jeschke
  • SIG '09 presentation ppt
  • NEW C++/Matlab (mex)code. Instructions: compile the C++ code to mex using makefile command from the matlab command line. Then run eaw_test.

 

 

http://www.cs.huji.ac.il/~raananf/projects/eaw/

 

function eaw_test

%%%%%%% Guided Edge-Aware Interpolation

clear
figure(2)

S = imread('gili_sc.bmp');
S = double(S) / 255 ;
G = imread('gili_bw.bmp');
G = double(G) / 255 ;
[w h c] = size(S) ;
nlevels = floor(log2(min(size(S(:,:,1))))) ;

figure(2)
subplot(2,2,1), imagesc(G), title('Input Image'), axis off, drawnow
subplot(2,2,2), imagesc(S), title('Input Scribbles'), axis off, drawnow

smth_factor = 0.125 ;

wave_type = 1 ;

[A W] = EAW(G(:,:,1),nlevels,wave_type,1,0) ; % construction wavelets weights based on guiding BW image (A not needed)

N = (abs(S(:,:,1) - S(:,:,2)) > 0.01) ; % extract scribbles 

for c=1:3
    tS = S(:,:,c) ;
    tS(~N) = 0;
    S(:,:,c) = tS ;
end

yuv = rgb2yuv(S) ; % operating on the UV of the YUV color space
U = yuv(:,:,2) ;
V = yuv(:,:,3) ;

N = double(N) ;  % normalization field

Au = gEAW(U,W,wave_type) ; % Forward transform using weights W
Av = gEAW(V,W,wave_type) ; 
An = gEAW(N,W,wave_type) ; 

for i=1:nlevels+1
    Au{i,1} = Au{i,1} * smth_factor^i ;
    Av{i,1} = Av{i,1} * smth_factor^i ;
    An{i,1} = An{i,1} * smth_factor^i ;
end

yuv(:,:,2) = igEAW(Au,W,wave_type) ; % inv transform using weight W
yuv(:,:,3) = igEAW(Av,W,wave_type) ;
N = igEAW(An,W,wave_type) ;


N(N<1e-8) = 1 ;
    
yuv(:,:,2) = yuv(:,:,2)./N;  % normalize (like Shepard method)
yuv(:,:,3) = yuv(:,:,3)./N;

Y = rgb2yuv(G) ;
yuv(:,:,1) = Y(:,:,1) ; % retrieve old Y channel
C = yuv2rgb(yuv) ;

C(C<0) = 0 ;
C(C>1) = 1 ;

subplot(2,2,3), imagesc(C), title('Regular Wavelets'), axis off, drawnow



[A W] = EAW(G(:,:,1),nlevels,wave_type,1,1) ; 

N = (abs(S(:,:,1) - S(:,:,2)) > 0.01) ; % extracting scribbles 

for c=1:3
    tS = S(:,:,c) ;
    tS(~N) = 0;
    S(:,:,c) = tS ;
end

yuv = rgb2yuv(S) ; % operating on the UV of the YUV color space
U = yuv(:,:,2) ;
V = yuv(:,:,3) ;

N = double(N) ;  % normalization field

Au = gEAW(U,W,wave_type) ; 
Av = gEAW(V,W,wave_type) ; 
An = gEAW(N,W,wave_type) ; 

for i=1:nlevels+1
    Au{i,1} = Au{i,1} * smth_factor^i ;
    Av{i,1} = Av{i,1} * smth_factor^i ;
    An{i,1} = An{i,1} * smth_factor^i ;
end

yuv(:,:,2) = igEAW(Au,W,wave_type) ;
yuv(:,:,3) = igEAW(Av,W,wave_type) ;
N = igEAW(An,W,wave_type) ;

N(N<1e-8) = 1 ;
    
yuv(:,:,2) = yuv(:,:,2)./N;  % normalize (like Shepard method)
yuv(:,:,3) = yuv(:,:,3)./N;


Y = rgb2yuv(G) ;
yuv(:,:,1) = Y(:,:,1) ; % retrieve old Y channel
C = yuv2rgb(yuv) ;

C(C<0) = 0 ;
C(C>1) = 1 ;

subplot(2,2,4), imagesc(C), title('Edge-Avoiding Wavelets'), axis off, drawnow




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function J = rgb2yuv(I)

M = [0.299 0.587 0.114 ; -0.147 -0.289 0.436 ; 0.615 -0.515 -0.1] ;

for c=1:3
    J(:,:,c) = M(c,1) * I(:,:,1) + M(c,2) * I(:,:,2) + M(c,3) * I(:,:,3) ;
end

function J = yuv2rgb(I)

M = inv([0.299 0.587 0.114 ; -0.147 -0.289 0.436 ; 0.615 -0.515 -0.1]) ;

for c=1:3
    J(:,:,c) = M(c,1) * I(:,:,1) + M(c,2) * I(:,:,2) + M(c,3) * I(:,:,3) ;
end


  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
关于证明三维self-avoiding random walk是transient的问题,其实这是一个非常复杂的数学问题,需要用到大量的数学知识和技巧。不过,我们可以简单地了解一下这个问题以及一些相关的概念。 首先,self-avoiding random walk是指在一个普通的随机游走的基础上,排除了走过的路径上出现的重复点,也就是说,每次只能向前走一步,而且不能走回已经走过的点。这个模型可以被用来描述一些物理、化学、生物学以及计算机科学等领域中的现象,比如高分子链的构象以及蛋白质的折叠等。 关于transient这个概念,简单来说,就是指这个随机游走的轨迹最终会离开某个特定的区域,并且不会回到这个区域中。这个区域可以是一个点、一条直线、一个平面,或者更一般地,一个固定的几何形状。相反,如果一个随机游走的轨迹在某一个区域中反复徘徊,那么这个随机游走就是recurrent的。 现在来考虑三维self-avoiding random walk是transient的问题。关于这个问题,已经有一些比较成熟的结论。比如,经典的Hammersley-Welsh定理指出,在三维空间中,self-avoiding random walk是transient的,也就是说,其轨迹最终会离开某个特定的区域,并且不会回到这个区域中。这个定理的证明非常复杂,需要用到很多高度抽象的数学工具,比如Brownian motion、Poisson point processes等等。 总之,证明三维self-avoiding random walk是transient的是一个非常复杂的数学问题,需要用到很多高深的数学技巧和知识。以上只是一个简单的介绍,希望对您有所帮助。如果您对这个问题还有其他的疑问,可以再问我,我会尽力为您解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值