Conversion of RGB Image into Intensity Image

2 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2013-8-18
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 2013-8-19
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by