I have a folder that contains around 400 color images, all of which need to be read for an image processing application. I want to read each image and save them in a variable/array. Any suggestions?
@simon:- thanx man. I have already used "dir" and "ls" instruction. that instruction list the file name in a variable. if I want to read the file, i have to use file name in a string.
since file name is stored in a variable, so i have to place that variable in a string. now can you tell me, how can we read a variable in a string?
%now n is number of file names listed in structure files
% to access file names use this:
datafiles(1).name % this will give you just the file name of the first file in the list
datafiles(1).fullname %this will give you absolute file name ... so with absolute path
%so now you can do for loop from 1 to n and print filenames to check if everything is %ok
%and now you can load your images using function load_images_n which I send before .... I am not sure if I send all dependecies I will check ...
%for example ... you have binary unsigned short images of size 500 x 400 pixels and you want to load them. this will load them as double precision data for further calculations
hi All maybe its to late to ask in this topic, but i found the exact problem as @Vinod Kumar ask before. i already used "dir" and "ls" and store it into a variable. if I want to read the file, i have to use file name in a string and since i have store file name in variable, and i also have tried @Qazi Nasir suggestion to add '@' in front of variable that contain all name file but somehow it didn't work for my code.... so how can i read a variable in a string? in this case i try to read a text file (.txt). any suggestion ? thank you :)