I am trying to use Shai Bagon's (@Shai) Graph Cut MATLAB Toolbox GCMex for the model from Statistics of Patch Offsets for Image Completion (Image Completion Approaches Using the Statistics of Similar Patches).
The model is given by:
Let's say the number of labels (Shifts) is 4 (Up by 1, down by 2, right by 3 or left by 4) to make things simpler.
I am still not sure how to set the data structures (Arrays) to utilize the solver.
Does anyone have idea?

I'm not sure my GCMex implementation supports this type of smoothness term.
If I understand correctly, you need, for each neighboring
i,jto compute a differentLxLmatrix of weights. The underlying c++ package (by Boykov et al) does support this, but I did not create an interface for this option.Update:
Let's say you have
npixels andlpossible labels.The current GCMex interface supports pair-wise weights of the form:
That is, the main "source" of pair wise penalty is a fixed
lxlmatrixS(L(i), L(j))that defines the penalty of assigning neighboring pixelsiandjto labelsL(i)andL(j)respectively. Thislxlweight does not depend on the location of the pixelsiandjonly on their labelsL(i)andL(j).The only spatial dependency comes from a scalar
w(i,j)that modulatesSby a scalar that depends on the locaiton ofiandj.However, it seems like in your case, what you actually need is a
lxlmatrix for each pairiandj.I think you should look into
void setSmoothness(smoothFnCoord cost);.