Borrar filtros
Borrar filtros

how to convert rgb image to 11*92 grayscale image of type 'pgm' ?

2 visualizaciones (últimos 30 días)
swathi
swathi el 19 de Dic. de 2013
Respondida: Image Analyst el 19 de Dic. de 2013
wen I try to conert an image using photo editor, the converted image size will b 112 92 3.. i.e. dimension wil b 3,, how can make it 1D?

Respuestas (2)

David Sanchez
David Sanchez el 19 de Dic. de 2013
First use
gray_image = rgb2gray(RGB_image);
The rescale the image:
B = imresize(gray_image, scale)
Take a look at
doc rgb2gray
doc imresize
The order of the operations can be reverse.

Image Analyst
Image Analyst el 19 de Dic. de 2013
% Convert to grayscale.
grayImage = rgb2gray(rgbImage);
% Resize to 11*92 or 112*92 (whatever is wanted), if necessary.
grayImage = imresize(grayImage, [112, 92]);
% Convert to pgm format disk file
imwrite(grayImage, 'myFile.pgm');

Categorías

Más información sobre Modify Image Colors en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by