【问题标题】:Invalid indexing operation error when trying to draw epipolar lines尝试绘制核线时出现无效的索引操作错误
【发布时间】:2014-06-07 10:57:23
【问题描述】:

我正在创建基于 Matlab 示例的立体图像处理项目。从其中一个复制粘贴的代码效果不佳。

I1 = rgb2gray(imread('viprectification_deskLeft.png'));
I2 = rgb2gray(imread('viprectification_deskRight.png'));

points1 = detectHarrisFeatures(I1);
points2 = detectHarrisFeatures(I2);

[features1, valid_points1] = extractFeatures(I1, points1);
[features2, valid_points2] = extractFeatures(I2, points2);

indexPairs = matchFeatures(features1, features2);

matchedPoints1 = valid_points1(indexPairs(:, 1),:);
matchedPoints2 = valid_points2(indexPairs(:, 2),:);

figure; showMatchedFeatures(I1, I2, matchedPoints1, matchedPoints2);
load stereoPointPairs

[fLMedS, inliers] = estimateFundamentalMatrix(matchedPoints1,matchedPoints2,'NumTrials',4000);

figure;
subplot(121); imshow(I1);
title('Inliers and Epipolar Lines in First Image'); hold on;
plot(matchedPoints1(inliers,1), matchedPoints1(inliers,2), 'go');

一个错误:

使用 EpilineTest 时出错(第 24 行)索引操作无效。

最好的问候

【问题讨论】:

  • 请包含完整的错误信息。哪条线路呼叫epilineTest
  • @Daniel epilineTest 是文件名,其中包含此代码 (epilineTest.m)。错误的全部内容如我所写: Error using epilineTest (line 24) Invalid indexing operation。 仅此而已
  • 第 24 行是哪一行?您的代码少于 24 行。
  • 错误在最后一行(23或24,可能有一段消失了,有人可以得到最后一行错误的不同索引)。这当然是包含在 epilineTest.m 中的完整代码。

标签: image-processing matlab matlab-cvst stereoscopy


【解决方案1】:

看起来您使用的是旧版本的 MATLAB。尝试这样做:

[fLMedS, inliers] = estimateFundamentalMatrix(...
      matchedPoints1.Location, matchedPoints2.Location,'NumTrials',4000);

通常,请查看您自己的本地 MATLAB 文档中的示例,而不是网站上的示例。该网站有最新版本(当前为 R2014a)的文档,示例可能使用了旧版本中不存在的新功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-30
    • 2021-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    相关资源
    最近更新 更多