Subversion Repositories seema-scanner

Rev

Rev 237 | Rev 241 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 237 Rev 238
Line 24... Line 24...
24
    xInit((k-1)*6+1:(k-1)*6+3) = wi*thetai;
24
    xInit((k-1)*6+1:(k-1)*6+3) = wi*thetai;
25
    
25
    
26
    xInit((k-1)*6+4:(k-1)*6+6) = initialAlign(k).Translation;
26
    xInit((k-1)*6+4:(k-1)*6+6) = initialAlign(k).Translation;
27
end
27
end
28
 
28
 
29
options = optimset('Algorithm', 'levenberg-marquardt', 'Display', 'iter-detailed', 'OutputFcn', @outfun, 'MaxIter', [], 'TolFun', 0, 'TolX', 0);
29
options = optimset('Algorithm', 'levenberg-marquardt', 'Display', 'iter-detailed', 'OutputFcn', @outfun, 'MaxIter', 100, 'TolFun', 0, 'TolX', 0);
30
[x, ~, ~] = lsqnonlin(@orthProcFun, xInit, [], [], options);
30
[x, ~, ~] = lsqnonlin(@orthProcFun, xInit, [], [], options);
31
 
31
 
32
alignment = struct('Rotation', {}, 'Translation', {});
32
alignment = struct('Rotation', {}, 'Translation', {});
33
for k=1:Np
33
for k=1:Np
34
    wi = x((k-1)*6+1:(k-1)*6+3);
34
    wi = x((k-1)*6+1:(k-1)*6+3);
Line 65... Line 65...
65
            %Npi = size(cat(1, Pbar{i,:}), 1);
65
            %Npi = size(cat(1, Pbar{i,:}), 1);
66
            for j=1:Nc
66
            for j=1:Nc
67
                % number of points in current cluster
67
                % number of points in current cluster
68
                Ncj = size(cat(1, Pbar{:,j}), 1);
68
                Ncj = size(cat(1, Pbar{:,j}), 1);
69
                if(not(isempty(Pbar{i,j})))
69
                if(not(isempty(Pbar{i,j})))
70
                    for k=setxor(1:Np, i)
70
                    for l=setxor(1:Np, i)
71
                        if(not(isempty(Pbar{k,j})))
71
                        if(not(isempty(Pbar{l,j})))
72
                            %e = [e; 1/Npi * norm(Pbar{k,j} - Pbar{i,j})];
72
                            %e = [e; 1/Npi * norm(Pbar{k,j} - Pbar{i,j})];
73
                            e = [e; sqrt(1/Ncj) * norm(Pbar{k,j} - Pbar{i,j})];
73
                            e = [e; sqrt(1/Ncj) * norm(Pbar{l,j} - Pbar{i,j})];
74
                            %e = [e; norm(Pbar{k,j} - Pbar{i,j})];
74
                            %e = [e; norm(Pbar{k,j} - Pbar{i,j})];
75
                        end      
75
                        end      
76
                    end   
76
                    end   
77
                end
77
                end
78
            end
78
            end