From: Yang on 10 Oct 2009 09:44 Hi, I am reading in a tif image file, and get the histogram of the image. However, getting the following error messages: Can anyone help me here? thanks song >> a = imread('song.tif'); >> figure, imhist(a); ??? Error using ==> iptcheckinput Function IMHIST expected its first input, I or X, to be two-dimensional. Error in ==> imhist>parse_inputs at 270 iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ... Error in ==> imhist at 57 [a, n, isScaled, top, map] = parse_inputs(varargin{:});
From: ImageAnalyst on 10 Oct 2009 09:57 On Oct 10, 9:44 am, "Yang " <songyang_2...(a)hotmail.com> wrote: > Hi, > I am reading in a tif image file, and get the histogram of the image. However, getting the following error messages: > Can anyone help me here? > > thanks > song > > >> a = imread('song.tif'); > >> figure, imhist(a); > > ??? Error using ==> iptcheckinput > Function IMHIST expected its first input, I or X, to be two-dimensional. > > Error in ==> imhist>parse_inputs at 270 > iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, .... > > Error in ==> imhist at 57 > [a, n, isScaled, top, map] = parse_inputs(varargin{:}); ---------------------------------------------------------------------------------------- You need to supply a 2D image. Put this line before the imhist line: size(a) % No semicolon What does it print out to the command window?
From: Sufiah Ahmad on 14 Oct 2009 02:01 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <d1188ec2-6505-443d-bbbd-224c30554d31(a)k33g2000yqa.googlegroups.com>... > On Oct 10, 9:44?am, "Yang " <songyang_2...(a)hotmail.com> wrote: > > Hi, > > I am reading in a tif image file, and get the histogram of the image. However, getting the following error messages: > > Can anyone help me here? > > > > thanks > > song > > > > >> a = imread('song.tif'); > > >> figure, imhist(a); > > > > ??? Error using ==> iptcheckinput > > Function IMHIST expected its first input, I or X, to be two-dimensional. > > > > Error in ==> imhist>parse_inputs at 270 > > iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ... > > > > Error in ==> imhist at 57 > > [a, n, isScaled, top, map] = parse_inputs(varargin{:}); > ---------------------------------------------------------------------------------------- > You need to supply a 2D image. Put this line before the imhist line: > size(a) % No semicolon > What does it print out to the command window? __________________________________________ I tried..still got error. the error are: ??? Error using ==> iptcheckinput Function IMHIST expected its first input, I or X, to be two-dimensional. Error in ==> imhist>parse_inputs at 270 iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, .... Error in ==> imhist at 57 [a, n, isScaled, top, map] = parse_inputs(varargin{:});
From: Steven Lord on 14 Oct 2009 09:25 "Sufiah Ahmad" <princesssufiah(a)gmail.com> wrote in message news:hb3pfg$d8u$1(a)fred.mathworks.com... > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message > <d1188ec2-6505-443d-bbbd-224c30554d31(a)k33g2000yqa.googlegroups.com>... >> On Oct 10, 9:44?am, "Yang " <songyang_2...(a)hotmail.com> wrote: >> > Hi, >> > I am reading in a tif image file, and get the histogram of the image. >> > However, getting the following error messages: >> > Can anyone help me here? >> > >> > thanks >> > song >> > >> > >> a = imread('song.tif'); >> > >> figure, imhist(a); >> > >> > ??? Error using ==> iptcheckinput >> > Function IMHIST expected its first input, I or X, to be >> > two-dimensional. >> > >> > Error in ==> imhist>parse_inputs at 270 >> > iptcheckinput(a, >> > {'double','uint8','logical','uint16','int16','single'}, ... >> > >> > Error in ==> imhist at 57 >> > [a, n, isScaled, top, map] = parse_inputs(varargin{:}); >> ---------------------------------------------------------------------------------------- >> You need to supply a 2D image. Put this line before the imhist line: >> size(a) % No semicolon >> What does it print out to the command window? > __________________________________________ > > I tried..still got error. > > the error are: > > ??? Error using ==> iptcheckinput > Function IMHIST expected its first input, I or X, to be two-dimensional. That's correct. Execute this code: a = imread('song.tif'); numberOfDimensions = ndims(a) If numberOfDimensions contains a value other than 2, you CANNOT use IMHIST on this image directly; you will need to convert it to a 2D image, perhaps by using RGB2IND if a is an m-by-n-by-3 array. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Sufiah Ahmad on 14 Oct 2009 22:21
Thanks Steve , I tried your suggestion. there's no error but the output is not the one that I want. ...Threre's no histogram ..it produce axis x & y with gray color only..no histogram bar "Yang " <songyang_2005(a)hotmail.com> wrote in message <haq331$5aj$1(a)fred.mathworks.com>... > Hi, > I am reading in a tif image file, and get the histogram of the image. However, getting the following error messages: > Can anyone help me here? > > > thanks > song > > >> a = imread('song.tif'); > >> figure, imhist(a); > ??? Error using ==> iptcheckinput > Function IMHIST expected its first input, I or X, to be two-dimensional. > > Error in ==> imhist>parse_inputs at 270 > iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ... > > Error in ==> imhist at 57 > [a, n, isScaled, top, map] = parse_inputs(varargin{:}); |