File Exchange

Moving Least Squares

version 1.0 (1.13 MB) by

Tools that implements the Moving Least Squares algorithm to deform points and images

3.66667
3 Ratings

Updated

This package contains a set of tools that allows to deform in real-time points and images using the Moving Least Squares algorithms. This is a fast technique to get good image deformations without using the computational expansive techniques provided by the thin-plates splines algorithms. The algorithm was published in the paper "Image Deformation Using Moving Least Squares" by Scott Schaefer, Travis McPhail, Joe Warren

Joe Xiao

Joe Xiao (view profile)

I am having trouble with the above mentioned problem. Can some one please provide some help on how to solve it? Especially the problem with inverting the computed forward lookup-coordinates?

Thanks!

Przem

Przem (view profile)

This implementation is wrong. The inverse-mapping computed in the function MLSD2DWarp is the wrong solution to the problem of backward image interpolation.

The paper of [Schaefer etal. 2006] provides the math for the forward-mapping and it cannot be inverted trivially. One possible solution is to swap the point-sets (p and q) and lose the benefits of the pre-computations, but one can use the fast backward-image-warping for interpolation.

One other solution is to compute the fast forward-mapping as in [Schaefer etal. 2006] and use the slow function "griddata" (or the slightly faster "TriScatteredInterp") instead of "interp2" in order to interpolate the image. In any case, it is not that fast...

Inverting the computed forward lookup-coordinates as done in this code is in any case wrong. You can observe this, if you pull on the handles: one cannot reconstruct the results of the papers. The handles one pulls are not followed by the interpolated image...

Alec

Alec (view profile)

This appears to be broken in version 2010b. MLSDeform crashes when you try to drag the points...

Okay, now I have fixed the dragging bug, but the deformations look totally wrong. The deformed image does not interpolate the control points. Is it possible that version changes in Matlab have botched this script?

Alec

Alec (view profile)

This appears to be broken in version 2010b. MLSDeform crashes when you try to drag the points...

Wei Qian

Shan Ming Koh

Shan Ming Koh (view profile)

This is a very good implementation of the MLSD algorithm. It allows me to understand the algorithm in greater detail better than the actual paper. Can I borrow these functions for testing/research purposes for my thesis project which is related to 2D image manipulations?

MATLAB Release
MATLAB 7.0.1 (R14SP1)