{"id":216,"date":"2008-06-17T07:00:34","date_gmt":"2008-06-17T11:00:34","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/2008\/06\/17\/batch-processing-revisited\/"},"modified":"2019-10-28T09:34:16","modified_gmt":"2019-10-28T13:34:16","slug":"batch-processing-revisited","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2008\/06\/17\/batch-processing-revisited\/","title":{"rendered":"Batch processing revisited"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p>Here's a very common question we receive:<\/p>\r\n      <p><i>\"How do I process a set of image files in a directory?\"<\/i><\/p>\r\n      <p>I first posted an <a href=\"https:\/\/blogs.mathworks.com\/steve\/2006\/06\/06\/batch-processing\/\">example<\/a> illustrating \"batch processing\" of a set of image files a couple of years ago.  The techniques are not specific to image\r\n         processing, though.  Loren <a href=\"https:\/\/blogs.mathworks.com\/loren\/2006\/08\/02\/processing-a-set-of-files\/\">covered this topic<\/a> in her <a href=\"https:\/\/blogs.mathworks.com\/loren\/\">Art of MATLAB blog<\/a>, and Doug posted a <a href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/02\/26\/matlab-basics-getting-a-directory-listing\/\">tutorial video<\/a> recently in <a href=\"https:\/\/blogs.mathworks.com\/pick\/\">Pick of the Week<\/a>.\r\n      <\/p>\r\n      <p>Today I've got a new batch processing example for you.  It was inspired by this question someone asked me recently: How can I\r\n         get a list of all the sample images shipped with the Image Processing Toolbox? This question provides a good excuse to show\r\n         a variety of different MATLAB tools and techniques that you might not have seen before, including:\r\n      <\/p>\r\n      <div>\r\n         <ul>\r\n            <li>Functions for manipulating file paths in a platform-independent manner<\/li>\r\n         <\/ul>\r\n      <\/div>\r\n      <div>\r\n         <ul>\r\n            <li>Determining all the file formats supported by <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/imread.html\"><tt>imread<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/imwrite.html\"><tt>imwrite<\/tt><\/a>, as well as the recognized file extensions for each format.\r\n            <\/li>\r\n         <\/ul>\r\n      <\/div>\r\n      <div>\r\n         <ul>\r\n            <li>Using the comma-separated list syntax on structure arrays<\/li>\r\n         <\/ul>\r\n      <\/div>\r\n      <div>\r\n         <ul>\r\n            <li>Sorting a structure array according to one of its fields<\/li>\r\n         <\/ul>\r\n      <\/div>\r\n      <div>\r\n         <ul>\r\n            <li>Generating HTML dynamically and displaying it in the MATLAB Web Browser.<\/li>\r\n         <\/ul>\r\n      <\/div>\r\n   <\/introduction>\r\n   <p>All of the toolbox sample images are stored in the same subdirectory of the MATLAB installation directory.  We can use <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlabroot.html\"><tt>matlabroot<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/fullfile.html\"><tt>fullfile<\/tt><\/a> to find the complete path.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">matlabroot<\/pre><pre style=\"font-style:oblique\">\r\nans =\r\n\r\nC:\\Program Files\\MATLAB\\R2008a\r\n\r\n<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">demos_folder = fullfile(matlabroot, <span style=\"color: #A020F0\">'toolbox'<\/span>, <span style=\"color: #A020F0\">'images'<\/span>, <span style=\"color: #A020F0\">'imdemos'<\/span>)<\/pre><pre style=\"font-style:oblique\">\r\ndemos_folder =\r\n\r\nC:\\Program Files\\MATLAB\\R2008a\\toolbox\\images\\imdemos\r\n\r\n<\/pre><p>The purpose of <tt>fullfile<\/tt> is to produce a valid path string on all MATLAB platforms.  That way, you don't have to worry about whether your code will\r\n      be running on a platform that uses \"\/\" or \"\\\" as the path separator.\r\n   <\/p>\r\n   <p>Did you know you can automatically determine all of the file formats supported by <tt>imread<\/tt> and <tt>imwrite<\/tt>?  The secret is to use a little-known function called <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/imformats.html\"><tt>imformats<\/tt><\/a>. This function returns a struct array containing information about format descriptions, recognized file extensions, and functions\r\n      to be used for reading and writing each format.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">f = imformats<\/pre><pre style=\"font-style:oblique\">\r\nf = \r\n\r\n1x16 struct array with fields:\r\n    ext\r\n    isa\r\n    info\r\n    read\r\n    write\r\n    alpha\r\n    description\r\n\r\n<\/pre><p>The number of elements of the structure array is the number of recognized image file formats.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">num_formats = numel(f)<\/pre><pre style=\"font-style:oblique\">\r\nnum_formats =\r\n\r\n    16\r\n\r\n<\/pre><p>Each element of the structure contains information about a particular format.  This information is used by <tt>imread<\/tt>, <tt>imwrite<\/tt>, and <tt>imfinfo<\/tt>.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">f(1)<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n            ext: {'bmp'}\r\n            isa: @isbmp\r\n           info: @imbmpinfo\r\n           read: @readbmp\r\n          write: @writebmp\r\n          alpha: 0\r\n    description: 'Windows Bitmap (BMP)'\r\n\r\n<\/pre><p>The <tt>ext<\/tt> field of the struct array is a cell array containing the recognized filename extensions for each format.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">f(1).ext<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n    'bmp'\r\n\r\n<\/pre><p>The reason <tt>ext<\/tt> is a cell array is that multiple extensions are recognized for certain formats.  For example:\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">f(3).ext<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n    'fts'    'fits'\r\n\r\n<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">f(7).ext<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n    'jpg'    'jpeg'\r\n\r\n<\/pre><p>Use the <a href=\"http:\/\/www.google.com\/search?q=comma%20separated%20list+site%3Amathworks.com+inurl%3Ahelpdesk\">comma-separated list syntax<\/a> to create a single list of all recognized extensions.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">extensions = [f.ext]<\/pre><pre style=\"font-style:oblique\">\r\nextensions = \r\n\r\n  Columns 1 through 7\r\n\r\n    'bmp'    'cur'    'fts'    'fits'    'gif'    'hdf'    'ico'\r\n\r\n  Columns 8 through 14\r\n\r\n    'jpg'    'jpeg'    'pbm'    'pcx'    'pgm'    'png'    'pnm'\r\n\r\n  Columns 15 through 19\r\n\r\n    'ppm'    'ras'    'tif'    'tiff'    'xwd'\r\n\r\n<\/pre><p>Now build up a list of image files in the Image Processing Toolbox demos folder.  Use <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/dir.html\">\r\n      <tt>dir<\/tt><\/a> in a loop to do directory listings of *.jpg, *.tif, *.bmp, etc.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\"><span style=\"color: #228B22\">% Initialize an empty struct array.<\/span>\r\nfiles = struct([]);\r\n<span style=\"color: #0000FF\">for<\/span> k = 1:numel(extensions)\r\n    files_k = dir(fullfile(demos_folder, sprintf(<span style=\"color: #A020F0\">'*.%s'<\/span>, extensions{k})));\r\n    files = [files; files_k];\r\n<span style=\"color: #0000FF\">end<\/span>\r\n\r\nfiles<\/pre><pre style=\"font-style:oblique\">\r\nfiles = \r\n\r\n64x1 struct array with fields:\r\n    name\r\n    date\r\n    bytes\r\n    isdir\r\n    datenum\r\n\r\n<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">files(1)<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n       name: 'solarspectra.fts'\r\n       date: '13-Oct-2002 08:48:02'\r\n      bytes: 66240\r\n      isdir: 0\r\n    datenum: 7.3150e+005\r\n\r\n<\/pre><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">files(2)<\/pre><pre style=\"font-style:oblique\">\r\nans = \r\n\r\n       name: 'football.jpg'\r\n       date: '01-Mar-2001 09:52:38'\r\n      bytes: 27130\r\n      isdir: 0\r\n    datenum: 7.3091e+005\r\n\r\n<\/pre><p>We might want to sort the image files alphabetically.  Do this by:<\/p>\r\n   <p>1. Make a cell array of file names.<\/p>\r\n   <p>2. Sort the cell array of file names and save the second output from <tt>sort<\/tt>.  (The second output is called the <i>permutation vector<\/i> of the sort.)\r\n   <\/p>\r\n   <p>3. Rearrange the structure array using the permutation vector.<\/p>\r\n   <p>Step 1:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">filenames = {files.name};<\/pre><p>Step 2:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">[filenames_sorted, idx] = sort(filenames);<\/pre><p>Step 3:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">files = files(idx);<\/pre><p>Now we construct HTML code for a page that displays all the sample image files in a bulleted list.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">html = cell(0,0);\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;html&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;head&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;title&gt;Image Processing Toolbox Demo Images&lt;\/title&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;\/head&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;body&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;h2&gt;Image Processing Toolbox Demo Images&lt;\/h2&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;ul&gt;'<\/span>;\r\n\r\n<span style=\"color: #0000FF\">for<\/span> k = 1:numel(files)\r\n    html{end+1} = <span style=\"color: #A020F0\">'&lt;li&gt;'<\/span>;\r\n    html{end+1} = files(k).name;\r\n    html{end+1} = <span style=\"color: #A020F0\">'&lt;\/li&gt;'<\/span>;\r\n<span style=\"color: #0000FF\">end<\/span>\r\n\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;\/ul&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;\/body&gt;'<\/span>;\r\nhtml{end+1} = <span style=\"color: #A020F0\">'&lt;\/html&gt;'<\/span>;<\/pre><p>We could save the generated HTML into a file.  But we can also display the HTML directly in the MATLAB Web Browser without\r\n      saving it. To do that, we need to:\r\n   <\/p>\r\n   <p>1. Construct a single character array that contains all of the HTML.<\/p>\r\n   <p>2. Prepend 'text:\/\/' to the HTML code.<\/p>\r\n   <p>3. Pass the resulting string to the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/web.html\"><tt>web<\/tt><\/a> function.\r\n   <\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">html_str = sprintf(<span style=\"color: #A020F0\">'%s\\n'<\/span>, html{:});\r\nweb([<span style=\"color: #A020F0\">'text:\/\/'<\/span>, html_str])<\/pre><p>Here's a screen shot showing the results in the MATLAB Web Browser:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2008\/demo_images_screen_shot.png\"> <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_6c07bf0dcca84cb8820ed267f6a3d50d() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='6c07bf0dcca84cb8820ed267f6a3d50d ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 6c07bf0dcca84cb8820ed267f6a3d50d';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Steve Eddins';\r\n        copyright = 'Copyright 2008 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_6c07bf0dcca84cb8820ed267f6a3d50d()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.6<br><\/p>\r\n<\/div>\r\n<!--\r\n6c07bf0dcca84cb8820ed267f6a3d50d ##### SOURCE BEGIN #####\r\n%%\r\n% Here's a very common question we receive:\r\n%\r\n% _\"How do I process a set of image files in a directory?\"_\r\n%\r\n% I first posted an \r\n% <https:\/\/blogs.mathworks.com\/steve\/2006\/06\/06\/batch-processing\/ \r\n% example> illustrating \"batch processing\" of a set of image files a\r\n% couple of years ago.  The techniques are not specific to image\r\n% processing, though.  Loren \r\n% <https:\/\/blogs.mathworks.com\/loren\/2006\/08\/02\/processing-a-set-of-files\/ \r\n% covered this topic> in her \r\n% <https:\/\/blogs.mathworks.com\/loren\/ Art of MATLAB blog>, and \r\n% Doug posted a \r\n% <https:\/\/blogs.mathworks.com\/pick\/2008\/02\/26\/matlab-basics-getting-a-directory-listing\/ \r\n% tutorial video> recently in \r\n% <https:\/\/blogs.mathworks.com\/pick\/ Pick of the Week>.\r\n%\r\n%\r\n% Today I've got a new batch processing example for you.  It was\r\n% inspired by this question some asked me recently: How can I get a\r\n% list of all the sample images shipped with the Image Processing\r\n% Toolbox? This question provides a good excuse to show a variety of\r\n% different MATLAB tools and techniques that you might not have seen\r\n% before, including:\r\n%\r\n% * Functions for manipulating file paths in a platform-independent\r\n% manner\r\n%\r\n% * Determining all the file formats supported by \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/imread.html \r\n% |imread|> and\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/imwrite.html \r\n% |imwrite|>, as well as the recognized file extensions for each\r\n% format.\r\n%\r\n% * Using the comma-separated list syntax on structure arrays\r\n%\r\n% * Sorting a structure array according to one of its fields\r\n%\r\n% * Generating HTML dynamically and displaying it in the MATLAB Web\r\n% Browser.\r\n\r\n%%\r\n% All of the toolbox sample images are stored in the same\r\n% subdirectory of the MATLAB installation directory.  We can use\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlabroot.html \r\n% |matlabroot|> and \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/fullfile.html \r\n% |fullfile|> to find the complete path.\r\n\r\n%%\r\nmatlabroot\r\n\r\n%%\r\ndemos_folder = fullfile(matlabroot, 'toolbox', 'images', 'imdemos')\r\n\r\n%%\r\n% The purpose of |fullfile| is to produce a valid path string on all\r\n% MATLAB platforms.  That way, you don't have to worry about whether\r\n% your code will be running on a platform that uses \"\/\" or \"\\\" as\r\n% the path separator.\r\n\r\n%%\r\n% Did you know you can automatically determine all of the file\r\n% formats supported by |imread| and |imwrite|?  The secret is to use\r\n% a little-known function called \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/imformats.html \r\n% |imformats|>. This function returns\r\n% a struct array containing information about format descriptions, \r\n% recognized file extensions, and functions to be used for reading\r\n% and writing each format.\r\n\r\nf = imformats\r\n\r\n%%\r\n% The number of elements of the structure array is the number of\r\n% recognized image file formats.\r\n\r\nnum_formats = numel(f)\r\n\r\n%%\r\n% Each element of the structure contains information about a\r\n% particular format.  This information is used by |imread|,\r\n% |imwrite|, and |imfinfo|.\r\n\r\nf(1)\r\n\r\n%%\r\n% The |ext| field of the struct array is a cell array containing the\r\n% recognized filename extensions for each format.\r\n\r\nf(1).ext\r\n\r\n%%\r\n% The reason |ext|\r\n% is a cell array is that multiple extensions are recognized for\r\n% certain formats.  For example:\r\n\r\nf(3).ext\r\n\r\n%%\r\n\r\nf(7).ext\r\n\r\n%%\r\n% Use the \r\n% <http:\/\/www.google.com\/search?q=comma%20separated%20list+site%3Amathworks.com+inurl%3Ahelpdesk \r\n% comma-separated list syntax> to create a single list of\r\n% all recognized extensions.\r\n\r\nextensions = [f.ext]\r\n\r\n%%\r\n% Now build up a list of image files in the Image Processing Toolbox\r\n% demos folder.  Use \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/dir.html\r\n% |dir| in a loop to do directory listings of *.jpg, *.tif, *.bmp,\r\n% etc.\r\n\r\n% Initialize an empty struct array.\r\nfiles = struct([]);\r\nfor k = 1:numel(extensions)\r\n    files_k = dir(fullfile(demos_folder, sprintf('*.%s', extensions{k})));\r\n    files = [files; files_k];\r\nend\r\n\r\nfiles\r\n\r\n%%\r\n\r\nfiles(1)\r\n\r\n%%\r\n\r\nfiles(2)\r\n\r\n%%\r\n% We might want to sort the image files alphabetically.  Do this by:\r\n%\r\n% 1. Make a cell array of file names.\r\n%\r\n% 2. Sort the cell array of file names and save the second output\r\n% from |sort|.  (The second output is called the _permutation\r\n% vector_ of the sort.)\r\n%\r\n% 3. Rearrange the structure array using the permutation vector.\r\n%\r\n% Step 1:\r\n\r\nfilenames = {files.name};\r\n\r\n%%\r\n% Step 2:\r\n\r\n[filenames_sorted, idx] = sort(filenames);\r\n\r\n%%\r\n% Step 3:\r\n\r\nfiles = files(idx);\r\n\r\n%%\r\n% Now we construct HTML code for a page that displays all the sample\r\n% image files in a bulleted list.\r\n\r\nhtml = cell(0,0);\r\nhtml{end+1} = '<html>';\r\nhtml{end+1} = '<head>';\r\nhtml{end+1} = '<title>Image Processing Toolbox Demo Images<\/title>';\r\nhtml{end+1} = '<\/head>';\r\nhtml{end+1} = '<body>';\r\nhtml{end+1} = '<h2>Image Processing Toolbox Demo Images<\/h2>';\r\nhtml{end+1} = '<ul>';\r\n\r\nfor k = 1:numel(files)\r\n    html{end+1} = '<li>';\r\n    html{end+1} = files(k).name;\r\n    html{end+1} = '<\/li>';\r\nend\r\n\r\nhtml{end+1} = '<\/ul>';\r\nhtml{end+1} = '<\/body>';\r\nhtml{end+1} = '<\/html>';\r\n\r\n%%\r\n% We could save the generated HTML into a file.  But we can also\r\n% display the HTML directly in the MATLAB Web Browser without saving\r\n% it. To do that, we need to:\r\n%\r\n% 1. Construct a single character array that contains all of the\r\n% HTML.\r\n%\r\n% 2. Prepend 'text:\/\/' to the HTML code.\r\n%\r\n% 3. Pass the resulting string to the \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/web.html\r\n% |web|> function.\r\n\r\nhtml_str = sprintf('%s\\n', html{:});\r\nweb(['text:\/\/', html_str])\r\n\r\n%%\r\n% Here's a screen shot showing the results in the MATLAB Web\r\n% Browser:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2008\/demo_images_screen_shot.png>>\r\n##### SOURCE END ##### 6c07bf0dcca84cb8820ed267f6a3d50d\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Here's a very common question we receive:\r\n      \"How do I process a set of image files in a directory?\"\r\n      I first posted an example illustrating \"batch processing\" of a set... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2008\/06\/17\/batch-processing-revisited\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[504,154,160,500,76,164,498,162,484,270,502,506],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/216"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":3604,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/216\/revisions\/3604"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}