我正在尝试使用Surf来对图像进行分类..我尝试使用Ecludian距离和神经网络对其进行了尝试,但它们均使我在2个数据库上的识别结果很差,所以我不知道这是怎么回事我 据我所知..我应该在分类中使用描述符...我是从功能
中获得的这是我的代码:
myFolder = 'E:\sherok\images of hands sherok';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.bmp');
jpegFiles = dir(filePattern);
a=[]
for k = 1:length(jpegFiles)
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName)
I1=imread(fullFileName);
I1 = rgb2gray(I1);
I1 = adapthisteq (I1);
I1 = imadjust(I1);
I1 = histeq (I1);
points1 = detectSURFFeatures(I1);
[features1, valid_points1] = extractFeatures(I1, points1.selectStrongest(10));
[filepath,name,ext] = fileparts(baseFileName);
file_name = sprintf('Surf_%s.mat',name);
save (file_name, 'features1','valid_points1', 'I1' ),
end
features1是我的描述符...我保存了它们,然后调用它们以计算每个图像和测试图像之间的Ecludian距离
对于神经网络,我通常将这些特征放入向量中,以得到训练集所有图像的矩阵和测试集相同的图像
谢谢,希望您对我有帮助