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
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
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 Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!