Borrar filtros
Borrar filtros

Conversion of RGB Image into Intensity Image

2 visualizaciones (últimos 30 días)
Pranjal Pathak
Pranjal Pathak el 18 de Ag. de 2013
Here I am adding a simple code which performs sharpening of an image:
% Clears command prompt and closes all windows
clear all;
close all;
% Read in image and display
im = imread('coin.png');
figure;
imshow(im);
% Create special unsharp mask filter
mask = fspecial('unsharp');
out = imfilter(im, mask);
% Display sharpened result
figure;
imshow(out);
My problem is that: I am operating the process on an 8 bit intensity image(which is named as 'coin' here), but after I perform the operation and save it, it automatically gets converted into an RGB image (8 bit). So, is there any procedure to get the resultant image ('out') as the same 8 bit intensity image? Please help me in this regard.
Thanks!
  2 comentarios
Image Analyst
Image Analyst el 18 de Ag. de 2013
How are you saving it? for example are you calling imwrite() and telling it to save as a BMP or JPG?
Amith Kamath
Amith Kamath el 19 de Ag. de 2013
could you please clarify what you mean by 8 bit RGB image? When I follow your code example, I see that 'out' is a 246x300 uint8, which is the same type as 'im'. Typically, RGB images have 3 layers, each of which are typically 8 bit wide.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Convert Image Type 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