MATLAB Source code
%Program To Read, Wirte and Display an Image
clear all;
close all;
clc;
I = imread('cameraman.tif');
[I1,map] = imread('trees.tif');
[I2,map] = imread('forest.tif');
%TO CONVERT ONE IMAGE FORMAT INTO ANOTHER FORMAT [(i.e.) from tif image to jpeg](OR) TO WRITE THE DATA IN AN IMAGE
imwrite(I,'cameraman.jpeg');
imwrite(I1,map,'trees.jpeg');
imwrite(I2,map,'forest.jpeg');
%TO READ AN IMAGE
J = imread('cameraman.jpeg');
K = imread('trees.jpeg');
M = imread('forest.jpeg');
%TO FIND OUT THE SIZE OF THE IMAGE
size(J)
size(K)
size(M)
disp('If the size is 2D Matrix it is a gray scale image');
disp('If the size is 3D Matrix it is a color image');
%TO DISPLAY AN IMAGE
figure(1)
imshow(J)
figure(2)
imshow(K)
figure(3)
imshow(M)
TUTOTIAL 2
%TO FIND OUT THE PIXEL VALUE OF AN IMAGE
clear all;
close all;
clc;
%TO READ AN IMAGE
J = imread('cameraman.jpeg');
imshow(J)
pixval;
TUTOTIAL 3
%TO GET ALL INFORMATION ABOUT AN IMAGE
%SUCH AS
%(1) File size
% (2) Number of Bits used to represent a pixel
% (3) Resoultion
% (4) Gray (or) Binary (or) Color Image
% (5) Width and Height
% (6) Maximum Pixel value
% (6) Image format such as TIFF (or) JPEG
clear all;
close all;
clc;
%TO READ AN IMAGE
J = imread('cameraman.jpeg');
imshow(J);
Image_Infromation = imfinfo('cameraman.jpeg')
Comments
Post a Comment