From: ImageAnalyst on 14 Oct 2009 22:46 Steve suggestion was just to diagnose your error. It did not do anything to fix the error, so how can you say there's no error now??????? It wouldn't have fixed anything. You aren't even telling us what you really did, nor following the suggestions. Do this a = imread('song.tif'); numberOfDimensions = ndims(a) size(a) DON'T DO ANYTHING ELSE! Just do this. Note that there are no semicolons after the last two lines. Now...after you've run this, copy and paste what you see in the command window back here in reply to posting. Next, try your code (imread and imhist) with the standard MATLAB demo image called cameraman.tif. Then see if there are any errors and paste them back here if you get any (but there won't be).
From: Sufiah Ahmad on 15 Oct 2009 00:10 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <b1ac4588-ec11-4ae2-8239-ea9d72660d6b(a)11g2000yqp.googlegroups.com>... > Steve suggestion was just to diagnose your error. It did not do > anything to fix the error, so how can you say there's no error > now??????? It wouldn't have fixed anything. You aren't even telling > us what you really did, nor following the suggestions. Do this > > a = imread('song.tif'); > numberOfDimensions = ndims(a) > size(a) > > DON'T DO ANYTHING ELSE! Just do this. Note that there are no > semicolons after the last two lines. Now...after you've run this, > copy and paste what you see in the command window back here in reply > to posting. > > Next, try your code (imread and imhist) with the standard MATLAB demo > image called cameraman.tif. Then see if there are any errors and > paste them back here if you get any (but there won't be). Thank you very much.... my image is in 3D.. so I have to convert it to 2D I tired the cameraman.tif..its works. So could you pleaseeeeee tell my how to convert my image to 2D? Below is my code, output and error. i= imread('d:nor.jpg'); >> numberOfDimension = ndims(i) numberOfDimension = 3 >> size(i) ans = 512 640 3 >> figure, imhist(i); ??? 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 15 Oct 2009 06:22 It's probably a color image (rather than a volumetric image like you'd get from MRI or CT). You could take one of the color channels like this: redBand = rgbImage(:,:,1); greenBand = rgbImage(:,:,2); blueBand = rgbImage(:,:,3); or you could use the "book" formula to convert to gray scale monochromeImage = rgb2gray(rgbImage) (or something like that). Or you could convert to hsv with rgb2hsv() and look at the V channel.
From: Sufiah Ahmad on 16 Oct 2009 00:34 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <c1aee1b6-64fd-47ad-b29b-7b4d0b43ff3d(a)g31g2000yqc.googlegroups.com>... > It's probably a color image (rather than a volumetric image like you'd > get from MRI or CT). You could take one of the color channels like > this: > redBand = rgbImage(:,:,1); > greenBand = rgbImage(:,:,2); > blueBand = rgbImage(:,:,3); > or you could use the "book" formula to convert to gray scale > monochromeImage = rgb2gray(rgbImage) (or something like that). > Or you could convert to hsv with rgb2hsv() and look at the V channel. Hi, I still got error. Below is my code. i = imread('d:nor.jpg'); >> reBand = i(:,:,1); >> gBand = i(:,:,2); >> bBand = i(:,:,3); >> figure, imhist(i); ??? 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{:}); >> monhro,eImage = rgb2gray(i); ??? Undefined function or variable 'monhro'. >> monochromeImage = rgb2gray(i); >> figure, imhist(i); ??? 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{:}); >> monCI = rgb2hsv(i); >> figure, imhist(i); ??? 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{:}); >> noOD =ndism(i) ??? Undefined function or method 'ndism' for input arguments of type 'uint8'. >> noOD =ndims(i) noOD = 3 >>
From: ImageAnalyst on 16 Oct 2009 07:51 Read my answer. Did you take one of the individual color channels, like the red one, the green one, or the blue one? NO. You STILL passed in the color image for some reason. Why do you think you extracted the individual color bands -- just for the heck of it? Pass in one of those monochrome images (individual color bands or the rgb2ind image) and you will be fine.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Transfer function using laplace Next: Normalizing RGB image |