2,基于点特征匹配的杂乱场景目标检测
第一步:读入图片;
wahaha1 = imread('wahaha.jpg');
wahaha=rgb2gray(wahaha1);
scenceImage = imread('scence.jpg');
sceneImage=rgb2gray(scenceImage);
第二步:检测特征点;
boxPoints = detectSURFFeatures(wahaha);
scenePoints = detectSURFFeatures(sceneImage);
figure;
imshow(wahaha);
title('100 Strongest Feature Points from wahaha Image');
hold on;
plot(selectStrongest(boxPoints, 100));
figure;
imshow(sceneImage);
title('300 Strongest Feature Points from Scene Image');
hold on;
plot(selectStrongest(scenePoints, 300));
第三步:提取特征描述子;
boxPairs = matchFeatures(boxFeatures, sceneFeatures);