查看: 91|回复: 0|关注: 0

[未答复] 提示索引超出矩阵维度 怎么办?

[复制链接]

新手

10 麦片

财富积分


050


1

主题

1

帖子

0

最佳答案
发表于 2020-5-23 18:07:15 | 显示全部楼层 |阅读模式
clear;
clc;
close all;

%% Initial Variables

imgfile_src = 'image_data';
scanfile_src = 'scan_data';

numFrames = 20;
linefeats_img_all = zeros(3,3,numFrames);
pointfeats_laser_all = zeros(4,3,numFrames);

%% Read and store feature data from all frames

for i = 1:numFrames

    % Load Image Line Features
    imgfile = [imgfile_src '/calibrationImage' sprintf('%4.4d', i-1) '.mat'];
    load(imgfile);
    pt1 = [imgLines(1,1); imgLines(1,2); 1]; pt2 = [imgLines(1,3); imgLines(1,4); 1];
    pt3 = [imgLines(2,1); imgLines(2,2); 1]; pt4 = [imgLines(2,3); imgLines(2,4); 1];
    pt5 = [imgLines(3,1); imgLines(3,2); 1]; pt6 = [imgLines(3,3); imgLines(3,4); 1];
    linefeats_img_all(:, 3, i) = cross(pt1, pt2);
    linefeats_img_all(:, 2, i) = cross(pt3, pt4);
    linefeats_img_all(:, 1, i) = cross(pt5, pt6);

    % Load Scan Point Features
    scanfile  = [scanfile_src '/scan' sprintf('%1.1d', i-1) '.mat'];
    load(scanfile);
    pointfeats_laser_all(:,:,i) = scanPoints;
end

%% Distance Error Minimization using Levenberg-Marquardt

% linefeats_img : 3 X N X F format (N : no. of lines, F : no. of frames)
% pointfeats_laser : 4 X N X F format (N : no. of points, F : no. of frames)
alpha = -pi/4; beta = 0; gamma = 0; tx = 0.1326; ty = -0.1075; tz = -0.0317;
x0 = [alpha; beta; gamma; tx; ty; tz];
numFramesOpt = 50;
x_soln = errorMinimization(linefeats_img_all(:,:,1:numFramesOpt), pointfeats_laser_all(:,:,1:numFramesOpt), x0);


回复主题 已获打赏: 0 积分

举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

快速回复 返回顶部 返回列表