Effacer les filtres
Effacer les filtres

Reading image files-batch

1 vue (au cours des 30 derniers jours)
as hz
as hz le 23 Sep 2012
Hi,
I am trying to read image files from a folder (not Matlab working folder) but it does not work
Code: files = dir('C:\Users\ell\Desktop\segon\seg_array\Tv*.png') rgbl = imread('C:\Users\ell\Desktop\segn\seg_array\', files(1).name);
Can someone please tell me what is the problem.
Thanks

Réponse acceptée

Image Analyst
Image Analyst le 23 Sep 2012
Please see the FAQ http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F for several ways. They'll have lines like this
folder = ''C:\Users\ell\Desktop\segon\seg_array';
filePattern = fullfile(folder, 'Tv*.png');
fileNames = dir(filePattern);
In the loop:
fullFileName = fullfile(folder, fileNames(k).name);
rgbImage = imread(fullFileName);

Plus de réponses (1)

Rodrigo
Rodrigo le 23 Sep 2012
second line should read: imread(strcat('C:\Users\ell\Desktop\segn\seg_array\', files(1).name));

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by