onsDemo_08.png" alt=""> <pre class="codeinput"><span class="keyword">end</span>

<span class="keyword">function</span>[Dx,Dy] = create_distortion_map(I,sig,alpha,gausswidth)
[w,h] = size(I);
Dx = zeros(w,h);
Dy = zeros(w,h);
<span class="keyword">for</span> i=1:w
    <span class="keyword">for</span> j=1:h
        Dx(i,j) = 2*rand()-1;
        Dy(i,j) = 2*rand()-1;
    <span class="keyword">end</span>
<span class="keyword">end</span>
h = fspecial(<span class="string">'gaussian'</span>,gausswidth,sig);

Dx = 