Software page for epitome

[e,ev,p,etr]=epitome(x,K,N,T,NIT,sc,e,ev);

%Uses the Expectation-Maximization (EM) algorithm to learn an N x N epitome from T,
% K x K patches drawn randomly from the input image x. If sc is provided, the epitome is learned
% by learning a sequence of epitomes at different scales. sc(1) is the first scale,
% sc(end) is the final scale. So, the first epitome is of size N*sc(1) x N*sc(1)
% and it is learned from the image x, scaled by a factor of sc(1). The resulting
% epitome is used to initialize the epitome at the next scale, and so on. At scale
% sc(i), the number of training patches selected is sc(i)^2*T. NIT iterations of
% EM are applied at each scale.

 

function z=reconstruct(x,K,e,ev,emod,SPC)
%
% Replaces the epitome (e,ev) of an image by another epitome image (emod)
% keeping the mapping intact. The routine can be used to edit images or to
% preprocess by coloring the image accoring to the image (see the segmentation
% part of the web page for more info). K specifies the patch size to use in
% mapping inference and SPC defines the patch spacing.
 

This software provides a quick way of learning the epitome that uses multiresolution. However, the better way is to look at multiple patch sizes simultaneously.

Example of use:

I=imread('dog.bmp');

[X Y C]=size(I);

[e,ev,p,etr]=epitome(double(I)/255,4,32,X*Y/3,4,[0.2 0.5 0.7 1]);

See also preprocessing example at www.research.microsoft.com/~jojic/segmentation.htm.