I was intially trying to input some urban area image with .img format but Matlab is not supporting..??..how can i input coloured input image of urban area and extract building
while processing a code for Image enhnacement..i am getting the following error could you please explain..?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
*Error using rgb2gray>parse_inputs (line 88) RGB must be a m x n x 3 array.
Error in rgb2gray (line 35) X = parse_inputs(varargin{:});*
Respuestas (2)
Iman Ansari
el 10 de Abr. de 2013
Editada: Iman Ansari
el 10 de Abr. de 2013
The error says why. Your input is not RGB. Try:
size('your input')
Image Analyst
el 10 de Abr. de 2013
After you call this line
im1 = imread('D:\12.jp2');
put these lines
[rows, columns, numberOfColorChannels] = size(im1) % No semicolon
if numberOfColorChannels > 1
% Do this only if you want to convert to gray level.
im1 = rgb2gray(im1);
% Optionally, can take the green channel instead of the above line
% im1 = im1(:, :, 2);
end
What does this print out in the command window?
6 comentarios
Joe Torr
el 8 de Feb. de 2015
I tried your step and it gave me the same error. I wonder if it's the fact that my image is .tiff have something to do with it. I'm just trying a basic step of getting only black and white colors. I started to try gray but that did'nt work as well.
Image Analyst
el 8 de Feb. de 2015
Joe, I don't know what you did. Post your own question separately, and attach your code and image and we'll answer it there.
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!