<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079</link>
    <title>MATLAB Central Newsreader - image import struct</title>
    <description>Feed for thread: image import struct</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 05 Nov 2009 11:55:03 -0500</pubDate>
      <title>image import struct</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079#692356</link>
      <author>Jeroen </author>
      <description>Hi!&lt;br&gt;
&lt;br&gt;
When i import an image with uiimport matlab gives the error:&lt;br&gt;
'MAP must be a m x 3 array.'&lt;br&gt;
&lt;br&gt;
But I am sure it is an RGB image. The code that I use is:&lt;br&gt;
meting = uiimport;&lt;br&gt;
meting_grayscale = rgb2gray(meting); %naar een grayscale&lt;br&gt;
meting_double = im2double(meting_grayscale); %naar een index&lt;br&gt;
&lt;br&gt;
And when I load an image it says in has the size 1024x1024x3. That is an a m x 3array. &lt;br&gt;
&lt;br&gt;
Do i have to convert the import image? Or do I have to change some settings? Or add another codeline? Or is it another the type of image?&lt;br&gt;
&lt;br&gt;
Thank you anyway!&lt;br&gt;
&lt;br&gt;
gr jeroen</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 13:14:54 -0500</pubDate>
      <title>Re: image import struct</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079#692376</link>
      <author>ImageAnalyst</author>
      <description>On Nov 5, 6:55&#160;am, &quot;Jeroen &quot; &amp;lt;bin...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When i import an image with uiimport matlab gives the error:&lt;br&gt;
&amp;gt; 'MAP must be a m x 3 array.'&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But I am sure it is an RGB image. The code that I use is:&lt;br&gt;
&amp;gt; meting = uiimport;&lt;br&gt;
&amp;gt; meting_grayscale = rgb2gray(meting); %naar een grayscale&lt;br&gt;
&amp;gt; meting_double = im2double(meting_grayscale); %naar een index&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; And when I load an image it says in has the size 1024x1024x3. That is an a m x 3array.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Do i have to convert the import image? Or do I have to change some settings? Or add another codeline? Or is it another the type of image?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you anyway!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; gr jeroen&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------------------------------------------------------&lt;br&gt;
True color RGB images are M x N x 3 and do not have a color map.&lt;br&gt;
Monochrome images are M x N and may or may not have a color map&lt;br&gt;
applied to them.&lt;br&gt;
If they use a color map, they are called &quot;indexed images&quot; by MATLAB&lt;br&gt;
and have a GL x 3 color map array where GL is the number of gray&lt;br&gt;
levels for that data type, for example 256 for uint8 images.&lt;br&gt;
So as you can see, with your color image, it makes no sense for it to&lt;br&gt;
talk about a colormap&lt;br&gt;
Hopefully that explanation will allow you to complete your work.</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 13:55:22 -0500</pubDate>
      <title>Re: image import struct</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079#692382</link>
      <author>Jeroen </author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;93efcec9-17cc-48db-82ca-3e3ce9348b9c@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Nov 5, 6:55?am, &quot;Jeroen &quot; &amp;lt;bin...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi!&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; When i import an image with uiimport matlab gives the error:&lt;br&gt;
&amp;gt; &amp;gt; 'MAP must be a m x 3 array.'&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; But I am sure it is an RGB image. The code that I use is:&lt;br&gt;
&amp;gt; &amp;gt; meting = uiimport;&lt;br&gt;
&amp;gt; &amp;gt; meting_grayscale = rgb2gray(meting); %naar een grayscale&lt;br&gt;
&amp;gt; &amp;gt; meting_double = im2double(meting_grayscale); %naar een index&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; And when I load an image it says in has the size 1024x1024x3. That is an a m x 3array.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Do i have to convert the import image? Or do I have to change some settings? Or add another codeline? Or is it another the type of image?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thank you anyway!&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; gr jeroen&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ---------------------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; True color RGB images are M x N x 3 and do not have a color map.&lt;br&gt;
&amp;gt; Monochrome images are M x N and may or may not have a color map&lt;br&gt;
&amp;gt; applied to them.&lt;br&gt;
&amp;gt; If they use a color map, they are called &quot;indexed images&quot; by MATLAB&lt;br&gt;
&amp;gt; and have a GL x 3 color map array where GL is the number of gray&lt;br&gt;
&amp;gt; levels for that data type, for example 256 for uint8 images.&lt;br&gt;
&amp;gt; So as you can see, with your color image, it makes no sense for it to&lt;br&gt;
&amp;gt; talk about a colormap&lt;br&gt;
&amp;gt; Hopefully that explanation will allow you to complete your work.&lt;br&gt;
&lt;br&gt;
Hi!&lt;br&gt;
&lt;br&gt;
Thank you. But that isn't what i ment.&lt;br&gt;
For my project I have to compare 2 images. A reference and a imported image.&lt;br&gt;
That import image is not the same image everytime. &lt;br&gt;
When I import an image by myself with imread there is nothing wrong, it is an unit8 type. But when I import the same image with uiimport it is an struct type. &lt;br&gt;
What is going wrong? Is the struct type the default value? Is there another way to import images without uiimport? &lt;br&gt;
&lt;br&gt;
thank you.&lt;br&gt;
&lt;br&gt;
gr jeroen</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 14:11:25 -0500</pubDate>
      <title>Re: image import struct</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079#692387</link>
      <author>Ashish Uthama</author>
      <description>On Thu, 05 Nov 2009 08:55:22 -0500, Jeroen  &amp;lt;bincky@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;lt;93efcec9-17cc-48db-82ca-3e3ce9348b9c@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; On Nov 5, 6:55?am, &quot;Jeroen &quot; &amp;lt;bin...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Hi!&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; When i import an image with uiimport matlab gives the error:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; 'MAP must be a m x 3 array.'&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; But I am sure it is an RGB image. The code that I use is:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; meting = uiimport;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; meting_grayscale = rgb2gray(meting); %naar een grayscale&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; meting_double = im2double(meting_grayscale); %naar een index&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; And when I load an image it says in has the size 1024x1024x3. That is  &lt;br&gt;
&amp;gt;&amp;gt; an a m x 3array.&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Do i have to convert the import image? Or do I have to change some  &lt;br&gt;
&amp;gt;&amp;gt; settings? Or add another codeline? Or is it another the type of image?&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Thank you anyway!&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; gr jeroen&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; ---------------------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt;&amp;gt; True color RGB images are M x N x 3 and do not have a color map.&lt;br&gt;
&amp;gt;&amp;gt; Monochrome images are M x N and may or may not have a color map&lt;br&gt;
&amp;gt;&amp;gt; applied to them.&lt;br&gt;
&amp;gt;&amp;gt; If they use a color map, they are called &quot;indexed images&quot; by MATLAB&lt;br&gt;
&amp;gt;&amp;gt; and have a GL x 3 color map array where GL is the number of gray&lt;br&gt;
&amp;gt;&amp;gt; levels for that data type, for example 256 for uint8 images.&lt;br&gt;
&amp;gt;&amp;gt; So as you can see, with your color image, it makes no sense for it to&lt;br&gt;
&amp;gt;&amp;gt; talk about a colormap&lt;br&gt;
&amp;gt;&amp;gt; Hopefully that explanation will allow you to complete your work.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hi!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you. But that isn't what i ment.&lt;br&gt;
&amp;gt; For my project I have to compare 2 images. A reference and a imported  &lt;br&gt;
&amp;gt; image.&lt;br&gt;
&amp;gt; That import image is not the same image everytime.&lt;br&gt;
&amp;gt; When I import an image by myself with imread there is nothing wrong, it  &lt;br&gt;
&amp;gt; is an unit8 type. But when I import the same image with uiimport it is  &lt;br&gt;
&amp;gt; an struct type.&lt;br&gt;
&amp;gt; What is going wrong? Is the struct type the default value? Is there  &lt;br&gt;
&amp;gt; another way to import images without uiimport?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; thank you.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; gr jeroen&lt;br&gt;
&lt;br&gt;
First, are you sure its UIIMPORT thats throwing the error message?&lt;br&gt;
Please study the entire stack on the error message. It might help if you  &lt;br&gt;
posted the full stack here too.&lt;br&gt;
&lt;br&gt;
Second, you can use IMFINFO on the 'failing' image file to study the file  &lt;br&gt;
format and ensure that your code is equipped to handle that time of images.</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 15:17:03 -0500</pubDate>
      <title>Re: image import struct</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265079#692429</link>
      <author>Jeroen </author>
      <description>&quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.u2xdpb06a5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; On Thu, 05 Nov 2009 08:55:22 -0500, Jeroen  &amp;lt;bincky@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;93efcec9-17cc-48db-82ca-3e3ce9348b9c@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; On Nov 5, 6:55?am, &quot;Jeroen &quot; &amp;lt;bin...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Hi!&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; When i import an image with uiimport matlab gives the error:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; 'MAP must be a m x 3 array.'&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; But I am sure it is an RGB image. The code that I use is:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; meting = uiimport;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; meting_grayscale = rgb2gray(meting); %naar een grayscale&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; meting_double = im2double(meting_grayscale); %naar een index&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; And when I load an image it says in has the size 1024x1024x3. That is  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; an a m x 3array.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Do i have to convert the import image? Or do I have to change some  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; settings? Or add another codeline? Or is it another the type of image?&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Thank you anyway!&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; gr jeroen&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; ---------------------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; True color RGB images are M x N x 3 and do not have a color map.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Monochrome images are M x N and may or may not have a color map&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; applied to them.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; If they use a color map, they are called &quot;indexed images&quot; by MATLAB&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; and have a GL x 3 color map array where GL is the number of gray&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; levels for that data type, for example 256 for uint8 images.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; So as you can see, with your color image, it makes no sense for it to&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; talk about a colormap&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Hopefully that explanation will allow you to complete your work.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Hi!&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thank you. But that isn't what i ment.&lt;br&gt;
&amp;gt; &amp;gt; For my project I have to compare 2 images. A reference and a imported  &lt;br&gt;
&amp;gt; &amp;gt; image.&lt;br&gt;
&amp;gt; &amp;gt; That import image is not the same image everytime.&lt;br&gt;
&amp;gt; &amp;gt; When I import an image by myself with imread there is nothing wrong, it  &lt;br&gt;
&amp;gt; &amp;gt; is an unit8 type. But when I import the same image with uiimport it is  &lt;br&gt;
&amp;gt; &amp;gt; an struct type.&lt;br&gt;
&amp;gt; &amp;gt; What is going wrong? Is the struct type the default value? Is there  &lt;br&gt;
&amp;gt; &amp;gt; another way to import images without uiimport?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; thank you.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; gr jeroen&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; First, are you sure its UIIMPORT thats throwing the error message?&lt;br&gt;
&amp;gt; Please study the entire stack on the error message. It might help if you  &lt;br&gt;
&amp;gt; posted the full stack here too.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Second, you can use IMFINFO on the 'failing' image file to study the file  &lt;br&gt;
&amp;gt; format and ensure that your code is equipped to handle that time of images.&lt;br&gt;
&lt;br&gt;
Hi!&lt;br&gt;
&lt;br&gt;
I'm sorry if it looks stupid but this is my first week with MATLAB.&lt;br&gt;
But when i typ IMFINFO it says:&lt;br&gt;
&amp;nbsp;Unable to open file &quot;meting_import&quot; for reading.&lt;br&gt;
The whole code is below:&lt;br&gt;
&lt;br&gt;
meting_import = uiimport;&lt;br&gt;
meting_grayscale = rgb2gray(meting_import);&lt;br&gt;
meting_double = im2double(meting_grayscale);&lt;br&gt;
meting_absoluut = abs(meting_double - 1);&lt;br&gt;
meting_resize = imresize(meting_double,inhoud); &lt;br&gt;
meting_x = meting_resize(:,512);&lt;br&gt;
figure;plot(meting_x);&lt;br&gt;
hold on;&lt;br&gt;
plot(ref_x,'r');grid;&lt;br&gt;
&lt;br&gt;
The error what i get is:&lt;br&gt;
??? Error using ==&amp;gt; rgb2gray&amp;gt;parse_inputs at 82&lt;br&gt;
MAP must be a m x 3 array.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; rgb2gray at 35&lt;br&gt;
X = parse_inputs(varargin{:});&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; import2 at 17&lt;br&gt;
meting_grayscale = rgb2gray(meting_import);&lt;br&gt;
&lt;br&gt;
So I think the error is in the rgb2gray, but i can't figure it how i can fix the error.&lt;br&gt;
&lt;br&gt;
thank you.&lt;br&gt;
&lt;br&gt;
gr jeroen</description>
    </item>
  </channel>
</rss>

