Thursday, March 24, 2011

How to give title for an image

Here we see about how to give title for an image.
Syntax:after reading and showing the image give title('Whatever title, you can give a title as per your image')
im=imread('1.jpg');
a=imresize(im,[400 400]);
b=imshow(a);
title('Input image');

Output:

Monday, March 7, 2011

How to convert rgb image to gray image


How to convert RGB image to GRAY level image?
Already we know how to read and show the image. So, first we have to read the input image.To convert rgb to gray the syntax is”rgb2gray”.
a=imread('1.jpg');
figure,imshow(a);
gray=rgb2gray(a)
figure,imshow(gray)

Original image:
Gray image:


Gray image ranges from 0 - 255.