Coder Social home page Coder Social logo

axbycz_calibration's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

axbycz_calibration's Issues

Error: util - meanCov sizes are incompatible

Arrays have incompatible sizes for this operation.

Error in meanCov (line 33)
Cov = Cov + diff_vex * diff_vex';

Complete function:

function [Mean, Cov] = meanCov( X )

N = size(X,3);
Mean = eye(4);
Cov = zeros(6,6);

%% Initial approximation of Mean
sum_se = zeros(4,4);
for i = 1:N
sum_se = sum_se + logm(X(:,:,i));
end
Mean = expm(1/N*sum_se);

%% Iterative process to calculate the true Mean
diff_se = ones(4,4);
max_num = 100;
tol = 1e-5;
count = 1;
while norm(diff_se,'fro') >= tol && count <= max_num
diff_se = zeros(4,4);
for i = 1:N
diff_se = diff_se + logm((Mean)\X(:,:,i));
end
Mean = Mean*expm(1/N * diff_se);
count = count+1;
end
% disp(['Number of iterations: ', num2str(count)]);

%% Covariance
for i = 1:N
diff_se = logm(Mean\X(:,:,i));
diff_vex = [vex(diff_se(1:3,1:3)); diff_se(1:3,4)];
Cov = Cov + diff_vex * diff_vex';
end
Cov = Cov/N;

%% Check
% meanCovCheck(Mean, Cov, X);
% len = 0.1;
% figure; hold on; axis equal;
% trplot(Mean,'color','r', 'length', len)
% for i = 1:N
% trplot(X(:,:,i), 'color', 'b', 'length', len)
% end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.