フィルターのクリア

8 bit depth RGB image(gif)

3 ビュー (過去 30 日間)
Mahua Nandy(Pal)
Mahua Nandy(Pal) 2012 年 3 月 11 日
is it possible to separate red ,green and blue channel of a 8 bit depth gif image with the following code?
redimg=im;
blueimg=im;
redimg(:,:,2:3)=0;
blueimg(:,:,1:2)=0;
greenimg=im;
greenimg(:,:,3)=0;
greenimg(:,:,1)=0;
if not then how can that be achieved?

採用された回答

Image Analyst
Image Analyst 2012 年 3 月 11 日
Copy and paste this example code:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
fontSize = 20;
% Change the filename to your filename!
[gifImage cmap] = imread('C:\Users\yourname\Pictures\whatever.gif');
% Display indexed GIF image.
subplot(2,3, 1);
imshow(gifImage);
% Convert to true color RGB image.
rgbImage = ind2rgb(gifImage, cmap);
title('GIF Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
subplot(2,3, 2);
imshow(rgbImage);
title('After conversion to RGB', 'FontSize', fontSize);
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Display the three component color channels.
subplot(2,3, 4);
imshow(redChannel);
title('Red Channel', 'FontSize', fontSize);
subplot(2,3, 5);
imshow(greenChannel);
title('Green Channel', 'FontSize', fontSize);
subplot(2,3, 6);
imshow(blueChannel);
title('Blue Channel', 'FontSize', fontSize);
  1 件のコメント
Mahua Nandy(Pal)
Mahua Nandy(Pal) 2012 年 3 月 12 日
thank u for clearing my doubts.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by