【发布时间】:2014-02-22 13:56:41
【问题描述】:
我正在研究关于室内定位功能的论文项目,但我在对象检测和跟踪方面没有任何问题。我使用的是MATLAB 2012a,但是代码的某些功能不起作用,可能是因为程序的旧版本。 你能给我一些建议吗? 特别是我对 showMatchedFeatures 和 estimateGeometricTransform 的功能有问题。 这是错误信息:
“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