Effacer les filtres
Effacer les filtres

Conversion of RGB Image into Intensity Image

2 vues (au cours des 30 derniers jours)
Pranjal Pathak
Pranjal Pathak le 18 Août 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 commentaires
Image Analyst
Image Analyst le 18 Août 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 le 19 Août 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by