75393

how i can read images from multiple folder in matlab?

Question:

My question I have folder of image organized as

Database -> CASIA Iris Image Database (version 1.0) -> folder001(this folder change to 001to 108) -> previouse folder contains two folder each of them contains 3 images

the structure of folder as

<a href="http://imageshack.us/photo/my-images/337/picture1ki.png/" rel="nofollow">http://imageshack.us/photo/my-images/337/picture1ki.png/</a>

how i can read CASIA V1.0 1 IN MATLAB?

Answer1:

Below is a generic code for any number of images in a folder. You can simplify it if you are sure to have 3 images per folder and you know the filename format for each.

%# Set the relative path for the database basePath = 'Database/CASIA Iris Image Database (version 1.0)/'; for iFolder = 1:108 %# Set current folder folder = sprintf('%s%03d/', basePath, iFolder); %# Find the image (e.g. bmp) files in the folder. Modify bmp for your needs. %# and also modify 'left' string according to the subfolder of left images filenames = arrayfun(@(x) x.name, dir([folder 'left/*.bmp']),'UniformOutput',false); for iFile = 1:length(filenames) img = imread([folder filenames{iFile}]); %# and process the image %# ... end %# Modify the code for to run it for right folder %# ... end

Recommend

  • Hide/show image on small screen
  • cvs2svn crash before end
  • Assigning an integer value to an output row, pentaho
  • Why does my colored cube not work with GL_BLEND?
  • How i do for work with objects with composition
  • Valums Ajax file Upload handle the up. file?
  • Argument 5: cannot convert from 'System.Drawing.Image' to 'string' - calling cla
  • Save image as is in photo album using swift
  • Google Places API - Find a company's CID and LRD
  • Write output of for loop to multiple files
  • Plotting densities in R
  • In-place sed command not working
  • Bootstrap (v3.3.4) glyphicons not displayed in IE when refresh page (F5)
  • OSX - always hide certain files
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • bad substitution shell- trying to use variable as name of array
  • Java color detection
  • IE7 and TinyMCE with Plone
  • Moving Android View and preventing onDraw to be called over and over again
  • Is playing sound in Javascript performance heavy?
  • Remove final comma from string in vb.net
  • How to render a blob on a canvas element?
  • HTTP/2 streams vs HTTP/1.1 connections
  • C++ Partial template specialization - design simplification
  • How to do unit test for HttpContext.Current.Server.MapPath
  • Syntax for setting draggablecursor property in google maps api
  • Is there a javascript serializer for JSON.Net?
  • Sails.js/waterline: Executing waterline queries in toJSON function of a model?
  • Where to put my custom functions in Wordpress?
  • GridView Sorting works once only
  • bootstrap to use multiple ng-app
  • How to get icons for entities from eclipse?
  • Buffer size for converting unsigned long to string
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Turn off referential integrity in Derby? is it possible?
  • How can I remove ASP.NET Designer.cs files?
  • JaxB to read class hierarchy
  • Binding checkboxes to object values in AngularJs
  • Unable to use reactive element in my shiny app
  • java string with new operator and a literal