Borrar filtros
Borrar filtros

Explain the working of commands..

2 visualizaciones (últimos 30 días)
harpreet  kaur
harpreet kaur el 9 de Mayo de 2015
Comentada: Walter Roberson el 10 de Mayo de 2015
Please explain what is the function of following command lines..??
if (size(im1,1)<=1000 && size(im1,2)<=1000)
status1 = system([sift_bin ' -x -o ' desc_file ' ' filename]);
else
status1 = system([sift_bin ' -d -x -o ' desc_file ' ' filename]);
end
if status1 ~=0
error('error calling executables');
end
Where,
sift_bin = fullfile('lib','sift','bin','siftfeat'); % e.g. 'lib/sift/bin/siftfeat' in linux
[pf,nf,ef] = fileparts(filename);
desc_file = [fullfile(pf,nf) '.txt'];
im1=imread(filename);

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 9 de Mayo de 2015
harpreet - which commands in particular? All of them? Presumably you have a file (image) that you want to analyze using the SIFT algorithms and so you first
% determine the path, name and extension of the file
[pf,nf,ef] = fileparts(filename);
% create a path to a text file using the path and name from filename
desc_file = [fullfile(pf,nf) '.txt'];
% read the file
im1=imread(filename);
% analyze given the size of the image
if (size(im1,1)<=1000 && size(im1,2)<=1000)
status1 = system([sift_bin ' -x -o ' desc_file ' ' filename]);
else
status1 = system([sift_bin ' -d -x -o ' desc_file ' ' filename]);
end
if status1 ~=0
error('error calling executables');
end
where system calls the SIFT feature executable at
lib/sift/bin/siftfeat
(which may or may not be a valid path to the exe on your workstation).
  2 comentarios
harpreet  kaur
harpreet kaur el 10 de Mayo de 2015
thanks geoff hayes. I particulary didn'd get
status1 = system([sift_bin ' -x -o ' desc_file ' ' filename]);
what are '-x -o' basically for..?
Walter Roberson
Walter Roberson el 10 de Mayo de 2015
The -x and -o have nothing to do with MATLAB. They are options being passed into the siftfeat executable.
I tracked down one version of the source to here
Scanning through it starting at line 90, we can see that -o followed by a filename outputs the keypoints to that file, and -x turns off the display of keypoints.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by