0% found this document useful (0 votes)
56 views

Experiment No. 8: MATLAB Program

This experiment uses MATLAB to filter color from an image. It loads an image, then sets specific color channels to zero to isolate individual colors. It displays the original image alongside processed images with only red, green or blue channels remaining. By manipulating the RGB color space matrix, the program filters color from the image.

Uploaded by

Anish Bansal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Experiment No. 8: MATLAB Program

This experiment uses MATLAB to filter color from an image. It loads an image, then sets specific color channels to zero to isolate individual colors. It displays the original image alongside processed images with only red, green or blue channels remaining. By manipulating the RGB color space matrix, the program filters color from the image.

Uploaded by

Anish Bansal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT NO.

8
Objective: Write a program to filter Colour from an image in MATLAB. Software Used: MATLAB R2010a About the Experiment:
In this experiment we will learn how to filter color in Matlab. Matlab provide very good Image processing tool box with many ready made functions. This experiment illustrated a very basic method to filter color in Matlab. The concept is- in the 3D matrix of RGB color space, if the value at a particular pixel have more value in Red space than blue or Green, and if it is within a tolerance value then consider that pixel Red.

MATLAB Program:
I=imread('C:\Users\Public\Pictures\Sample Pictures\inarc.jpg'); subplot(2,2,1);imshow(I);title('original image'); S=size(I); for i=1:S(1) for j=1:S(2) I(i,j,2)=0; end; end; subplot(2,2,2);imshow(I);title('processed image1'); for i=1:S(1) for j=1:S(2) I(i,j,2)=0; I(i,j,3)=0; end; end; subplot(2,2,3);imshow(I);title('processed image2'); for i=1:S(1) for j=1:S(2) I(i,j,2)=0; I(i,j,3)=0; I(i,j,1)=0; end; end; subplot(2,2,4);imshow(I);title('processed image3');

Result:

You might also like