【问题标题】:Matlab 2012a Object Detection and Tracking doesn't workMatlab 2012a 对象检测和跟踪不起作用
【发布时间】:2014-02-22 13:56:41
【问题描述】:

我正在研究关于室内定位功能的论文项目,但我在对象检测和跟踪方面没有任何问题。我使用的是MATLAB 2012a,但是代码的某些功能不起作用,可能是因为程序的旧版本。 你能给我一些建议吗? 特别是我对 showMatchedFeaturesestimateGeometricTransform 的功能有问题。 这是错误信息:

“SURFPoints”类型的输入参数的未定义函数“showMatchedFeatures”。

如何在不下载新版 Matlab 的情况下解决我的问题?

这是代码:

`

boxImage = imread('img_box.png');
sceneImage = imread('img_desk.png');
I= rgb2gray (boxImage);
K= rgb2gray (sceneImage);

boxPoints = detectSURFFeatures(I)
scenePoints = detectSURFFeatures(K);

figure; imshow(I);
title('100 Strongest Feature Points from Box Image');
hold on;
plot(boxPoints.selectStrongest(100));

figure; imshow(K);
title('300 Strongest Feature Points from Scene Image');
hold on;
plot(scenePoints.selectStrongest(300));


[boxFeatures, boxPoints] = extractFeatures(I, boxPoints);
[sceneFeatures, scenePoints] = extractFeatures(K, scenePoints);

boxPairs = matchFeatures(boxFeatures, sceneFeatures);
matchedBoxPoints = boxPoints(boxPairs(:, 1), :);
matchedScenePoints = scenePoints(boxPairs(:, 2), :);
figure;
showMatchedFeatures(boxImage, sceneImage, matchedBoxPoints,matchedScenePoints, 'montage');
title('Putatively Matched Points (Including Outliers)');



[tform, inlierBoxPoints, inlierScenePoints] = ...
    estimateGeometricTransform(matchedBoxPoints, matchedScenePoints, 'affine');

boxPolygon = [1, 1;...                           % top-left
        size(boxImage, 2), 1;...                 % top-right
        size(boxImage, 2), size(boxImage, 1);... % bottom-right
        1, size(boxImage, 1);...                 % bottom-left
        1, 1];                   % top-left again to close the polygon

newBoxPolygon = transformPointsForward(tform, boxPolygon);

figure; imshow(sceneImage);
hold on;
line(newBoxPolygon(:, 1), newBoxPolygon(:, 2), 'Color', 'y');
title('Detected Box');

end

`

感谢您的帮助!

【问题讨论】:

  • 计算机视觉工具箱已安装并获得许可?

标签: matlab feature-detection feature-extraction matlab-cvst


【解决方案1】:

假设您安装了计算机视觉系统工具箱,您可以使用vision.GeometricTransformEstimator 对象而不是estimateGeometricTransform 函数。

至于showMatchedFeatures,使用imshowpairplot很容易实现。

话虽如此,自 2012a 以来,工具箱中已添加了许多很酷的功能,因此值得升级。

【讨论】:

    【解决方案2】:

    您可以检查计算机视觉工具箱,看看它是否已安装。因为 SURF 需要那个工具箱。可能我可以建议你使用 SIFT 而不是 Surf。它很容易实现。这是一个对您有用的链接。

    This is a link where you can download the library

    这里是教程链接

    This tutorial will help u more on how SIFT can be used

    在matlab中使用ver命令检查安装的工具箱

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 2019-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多