calling a sequence of images for processing

3 vues (au cours des 30 derniers jours)
Harry
Harry le 15 Juil 2013
I have a part of my code shown below which allocates the file name of a sequence of images so that it can be read with the imread command but for some reason it adds a space inside the file name so the name is invalid:
if k ~= 1
if k < 10
num = k - 1;
file_num = strcat('0',num,'.')
else
file_num = strcat(num,'.');
end
image_file_name = strcat(file, image_name, file_num,'jpg');
M = imread(image_file_name);
else
file_num = '00';
end
And it gives me the error:
Error using imread (line 350)
File "C:\Users\bostock_h\Documents\Images\i130614_075_large\i130614_074-1000 .jpg" does not exist.
Error in image_processing_project4 (line 61)
M = imread(image_file_name);
So as you can see there is a break after the file number with a space. But I don't know where it's coming from??

Réponse acceptée

Matt J
Matt J le 15 Juil 2013
Perhaps you meant
num = num2str(k - 1);

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by