Code covered by the BSD License  

Highlights from
[SigGraph2002] Image Quilting/Texture Synthesize

image thumbnail
from [SigGraph2002] Image Quilting/Texture Synthesize by Li Cheng
Matlab code to do Image Quilting as presented in the SIGGRAPH 2002 paper by Efros & Freeman.

getxcorr2(A,B)
function Ans = getxcorr2(A,B)


if ( size(A,3) == size(B,3) )
    Ans = xcorr2(A(:,:,1),B(:,:,1));
    for i = 2 : size(A,3)
        Ans = Ans + xcorr2(A(:,:,i),B(:,:,i));
    end
else
    if( size(B,3) ==1)
        Ans = xcorr2(A(:,:,1),B(:,:));
        for i = 2 : size(A,3)
            Ans = Ans + xcorr2(A(:,:,i),B(:,:));
        end
    else
        if(size(A,3)==1)
            Ans = getxcorr2(B,A);
        else
            Ans = xcorr2(A(:,:,1),B(:,:,1));
        end
    end
end

Contact us