I have a sequence of images and I want to apply something (Gabor filter) on each of the images?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Rida
am 1 Apr. 2014
Kommentiert: Image Analyst
am 1 Apr. 2014
Problem is, when I apply Gabor on a single image, I get perfect results, but when I access the entire images , it only operates on the last image in the folder, most probably others are over written, how can I access each individual image in a folder??
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Apr. 2014
See the FAQ for code examples: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F like this:
myFolder = 'C:\Documents and Settings\yourUserName\My Documents\My Pictures';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
for k = 1:length(jpegFiles)
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
drawnow; % Force display to update immediately.
end
2 Kommentare
Image Analyst
am 1 Apr. 2014
Not exactly sure what you're describing, but yeah, that's all possible (whatever it is). Just do normal MATLAB programming commands. http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!