Wednesday, May 15, 2013

READING,DISPLAYING AND WRITING AN IMAGE

Unknown | 8:05 AM |

Reading Image

the images are read into matlab environment ( for processing) using the command line given below
>> ima=imread(‘filename’);
here filename is the name of the image file including file extension and ima is variable that store the image in the format of matrix

Format name
Description
Extension
TIFF
Tagged Image File Format
.tif, .tiff
JPEG
Joint Photographic Expert Group
.jpg, .jpeg 
GIF
Graphics Interchange Format
.gif
BMP
Windows Bitmap
.bmp
PNG
Portable Network Graphics
.png
XWD
X Window Dump
.xwd
TIFF Image
  • Multiple images and data in the same file
  • Tags in file header (information on size, compression)
  • Loss-less format, useful for archival images
  • Platform independent
  • Format useful for future modification – can edited without compression loss
JPEG Image
  • Strongest format for web images and printing images
  • Superior quality can be produced Variety of compression capability
  • Best method for online viewing
GIF Image
  • Very old format
  • Lossless compression format
  • Less storage space
  • Strong candidate for graphic art and drawing.
PNG Image
  • A new format
  • Created to improve on GIF format
  • Supports 24-bit color or grayscale
  • Provides for variety of transparency
  • Lossless data compression
Example:-
>>ima=imread(‘image.jpg’);
the images can also read by mentioning the path of image
>> ima1=imread('C:\Documents and Settings\username\Desktop\finger_print.tif');
image
you can also read the image by following command
>>[filename pathname]=uigetfile({'*.bmp';'*.jpg';'*.png';'*.tif'},'Select image ');
a=imread([pathname filename]);
here pathname store the path of the file and filename store name of the file
image

Displaying Image

image can displayed using the command given below
>>imshow(ima,G);
where ima is variable that stored the image in form of matrix,and G is maximum intensity level in image ima. if G is omitted it is set 256 by default,
>>imshow(ima);
in the above command G value is set to 256 by default
image
image can also displayed using syntax below
>>imshow(ima,[low high]);
all the value less than or egual to low are displayed as BLACK ,and  all the value less than or egual to high are displayed as WHITE.
image

Writing Image

an Image can be written into harddisk using command given below
>>imwrite(ima,’filename’);
where ima is variable that stored image in the form of matrix and filename is name give for written
Example
>>imwrite(ima,’myimage.tif’);
alternatively
>>imwrite(ima,’myimage’,’tif’);
image

No comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Search

Infolinks In Text Ads

Total Pageviews

Subscribe here

Enter your email address:

Delivered by FeedBurner