Rank: 36568 based on downloads (last 30 days) and 0 files submitted
photo

Steffen

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Steffen View all
Updated File Comments Rating
31 Jul 2009 Point set registration (Rigid and Non-rigid). Rigid, Affine and Non-rigid point set registration toolbox. Coherent Point Drift (CPD) algorithm. Author: Andriy Myronenko

I checked the code and found out that one cannot use normalization and fixed scaling together. So, I set opt.normalize=0. however, the computed transformation seems to be far away from the optimal transformation. here is my test code:

function test_rigidTranform_noScaling( )

X = [121.3102 58.0957 46.3863
    83.3762 82.3011 69.5807
    88.7430 46.7092 84.9432
    51.3302 67.5140 109.3134];

Y = [36.7239 68.1019 52.6539
    61.0168 46.4281 88.7562
    76.5892 82.4971 84.0007
    99.3448 58.1160 121.3272];

% Set the options
opt.method='rigid'; % use rigid registration
opt.viz=0; % show every iteration
opt.outliers=0; % do not assume any noise

opt.normalize=0; % normalize to unit variance and zero mean before registering (default)
opt.scale=0; % fixed global scaling = 1
opt.rot=1; % estimate strictly rotational matrix (default)
opt.corresp=1; % compute the correspondence vector at the end of registration (default)

opt.max_it=100; % max number of iterations
opt.tol=1e-8; % tolerance

% registering Y to X
[Transform] = cpd_register(X,Y,opt);

figure,cpd_plot_iter(X, Y); title('Before');
figure,cpd_plot_iter(X, Transform.Y); title('After registering Y to X');

% compute error as mean minimum distance between points
error_before = computeError(X, Y)
error_after = computeError(X, Transform.Y)

    function [E, D] = computeError(X, Y)
        %compute for each x the euclidean distance to the closest y
        for i = 1 : size(X,1)
            D(i) = min(sqrt(sum((repmat(X(i,:), size(Y,1), 1) - Y).^2,2)));
        end
        E = mean(D);
    end
end

Any idea, what's going on? I noticed that in cpd_rigid.m the value of ntol can be negative: ntol=(L-L_old)/L; I'm not sure if this is intended. I changed it to ntol=abs((L-L_old)/L). The registration result is only slightly better, though.

Another minor thing. In cpd_register.m the line
if ~isfield(opt,'viz') || isempty(opt.tol), opt.viz = 1; end;
should be
if ~isfield(opt,'viz') || isempty(opt.viz), opt.viz = 1; end;

Best,
Steffen.

31 Jul 2009 Point set registration (Rigid and Non-rigid). Rigid, Affine and Non-rigid point set registration toolbox. Coherent Point Drift (CPD) algorithm. Author: Andriy Myronenko

great work, Andriy.

Is there any way to register with translation and rotation only without scaling? I set the .scale option to 0, but the scaling value in the computed transformation is not equal to 1.

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com