How do I create a matrix of the surf features for about 100 images?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lauren Pitts
el 31 de Jul. de 2019
Comentada: Pinaki Saha
el 16 de Nov. de 2021
Basically, I'm creating a Neural Network.. I have all of my images and I have the code to detect the SURF Features. Now, I need help to place the images with detected features into a matrix please.
This is the SURF code with the image it display with SURF points. I need to do this for 300 images made into a matrix to start training my NN.
clear;
close all;
I = imread('D:\test\chair\0001.png');
figure; imshow(I);
I = rgb2gray(I);
figure; imshow(I);
points = detectSURFFeatures(I);
figure;
imshow(I); hold on;
plot(points.selectStrongest(10));
[features, valid_points] = extractFeatures(I, points);
plot(valid_points.selectStrongest(5),'showOrientation',true);
3 comentarios
KALYAN ACHARJYA
el 6 de Ag. de 2019
@Prabhan is already answerd, hope the problem is resolved, if not let me know?
Respuesta aceptada
Prabhan Purwar
el 5 de Ag. de 2019
Editada: Rena Berman
el 3 de Oct. de 2019
Hello,
I am assuming that you are making use of a Neural Network for classification purpose.
Following code makes a row-wise matrix for 300 images using SURF features as descriptors.
clear;
close all
clc;
for i=1:300
st=strcat('D:\test\chair\000',num2str(i,'%02d'),'.png');
I = imread(st);
I = rgb2gray(I);
points = detectSURFFeatures(I);
[features, valid_points] = extractFeatures(I, points);
[s1,s2]=size(features);
S=s1*s2;
ftr=reshape(features,1,S);
F(i,:)=ftr;
end
The following link describes basic image classification using a simple convolution Neural Network:
- https://www.mathworks.com/help/deeplearning/gs/create-simple-deep-learning-classification-network.html
- https://www.mathworks.com/videos/what-is-deep-learning-toolbox--1535667599631.html
I would like to suggest you make use of "Image category classification using a bag of features approach" which uses SURF features and SVM classifier. This gives you a single vector that you can use at the input to a neural network or any other classifier of your choice.
Please refer to the following link: https://www.mathworks.com/help/vision/examples/image-category-classification-using-bag-of-features.html
3 comentarios
Andrea Daou
el 15 de Jun. de 2021
Hello, I am trying to use your code but for each image the number of SURF features will change so the final matrix F cannot be generated because at each loop iteration F(k,:) changes size.
Do you have any idea how can I fix this problem?
Thank you in advance!
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!