Mat Lab Code - DIGITAL IMAGE PROCESSING -Extract the Red band from the colour image


clc
close all

% Read the colour image and resize it to 256 x 256
myimage = imread('zoo1.jpg');
mycolourimage = imresize(myimage,[256,256],'nearest');

%Display the Colour Image
subplot(2, 4, 1);
subimage(mycolourimage), title('Original colour image');
axis off; axis equal;

% Extract the Red band from the colour image

myredimage = mycolourimage(:, :, 1);
subplot(2, 4, 2);
subimage(myredimage); title('Red channel');
axis off; axis equal;

% Display the histogram of the Red channel

subplot(2, 4, 3);
imhist(myredimage); title('Red channel');
axis off;

%Convert the colour image to Grey level image

mygrayimage = rgb2gray(mycolourimage);
subplot(2, 4, 4);
subimage(uint8(mygrayimage)), title('Grey image-8 bits');
axis off; axis equal;

% Resolution demo
% let us convert mygrayimage to 8-bit image for resolution demo
% Reduce the resolution to 8 X 8

myreducedimg = uint8(mygrayimage);
myreducedresolutionimg = imresize(imresize(myreducedimg,1/16),16);
subplot(2, 4,5);
subimage(myreducedresolutionimg), title('resolution now 16 x 16');
axis off; axis equal;

% Quantization demo
% let us convert mygrayimage to 8-bit image for resolution demo
% Reduce the resolution to 8 X 8

subplot(2,4,6);
subimage(grayslice(myreducedimg,2),gray(2));
title('Quantized image with 4 bits');
axis off; axis equal;

% generate a syntheic Image
% Matlab command phantom is used to generate a 64 x 64 image
subplot(2, 4, 7);
p = phantom('Modified Shepp-Logan',64);
subimage(p), title('Synthetic image');
axis off; axis equal;

%Display the grey level image using Pesudocolour using colormap(Jet(256)).
% This is the default colour map used to display the pesudocolour image

subplot(2, 4, 8);
subimage(mygrayimage,colormap(jet(256))), title('Pseudocolour image');
axis off; axis equal;

Mat Lab Code - DIGITAL IMAGE PROCESSING -Extract the Red band from the colour image Mat Lab Code - DIGITAL IMAGE PROCESSING -Extract the Red band from the colour image Reviewed by Suresh Bojja on 8/25/2015 08:19:00 AM Rating: 5

Subjects & Labs

AC (6) ADS (2) ATMEL (6) AWP (5) C- Language (3) CAO (5) CDAC (1) Cloud Computing (1) CMC (6) CN (10) CONSERVATION & MANAGEMENT Complete Notes (1) Control Sys (2) CVSM (2) Data Analytics (1) DC (5) Digital System Design (3) DIP (17) DLD (10) DLD Lab Manual (1) DS (4) DSD&DICA (9) DSP (6) EDC (45) Electonic Components (2) Embedded (7) EMWTL (6) ENERGY AUDIT (1) Engg. Mechanics (2) Engg.Chemistry (11) Faculty Files (6) Faculty Labs (1) Fuzzy (3) II MID (1) Job Exam Papers (4) LICA (1) Linux OS (1) Materials (1) MATLAB (27) MCU IDE 8051 (1) MEMS (4) MPMC (57) MPMC LAB Manual (3) MTECH (6) MWE (2) OC (1) PDC (9) Projects (8) RADAR (1) Research (9) RVSP (3) SC (1) Softwares (1) SS (2) STLD (19) TCSS (1) TSSN (1) TV Engg (1) VHDL (4) VLSI (8) VLSI Lab manual (1) WCN (1) Wireless Commu. (1) WSN (2)
Theme images by sebastian-julian. Powered by Blogger.