Professional Documents
Culture Documents
ind2rgb(image,map);
Eg.
a) g1=ind2rgb(b,c);
>> imshow(g1)
5] to convert an image to black and white or binary.the image can be rgb,index
ed or grayscale image.use command:im2bw(Image,level);
* level will decide the threshold value .if level is 0.5 then the value abo
ve 0.5 will be given 1 and 0 vice versa.(0.5 means 50% pixel value);
Eg.
a)
b)
j1=im2bw(a,0.65);
>> imshow(j1)
k1=im2bw(b,c,0.3);
>> imshow(k1)
(RGB IMAGE)
(INDEXED IMAGE)
to adjust the i
Eg.:- c=imadjust(a,[0.3,0.4],[0.5,0.6]);
>> imshow(c)
* high in and high out always has high intensity so we generally saturate
low in and low out..
Eg. e2=imadjust(a,[0.3,0.4],[]);
out saturation we use it.
For RGB imges:- i) imadjust(image name, [ high in R,high in G,high in B ; low in R , low i
n G, low in B])
here the matrix is of 2*3
** this command will increase intensity of each color in images.
Eg. >> a=imread('rgb.tif');
>> a1=imadjust(a,[0.2 0.3 0.4;0.5 0.6 0.7]);
>> imshow(a1)
*** contrast for high in and high out is always high so there is no need of a
djusting intensity of the image.
7] TO SHARPEN AN IMAGE:a) imsharpen(Image name);
* it will sharpen the image edges.
but to do it manually by user we use following command:use command:b) imsharpen(Image,'radius',radius value,'amount',amount value);
we use sharpen command when image is blur...high amount of sharpening will
give very sharp image...
8] TO IMAGE CONTRAST ADJUSTMENT BY IMCONTRAST ADJUSTMENT TOOL;Eg. a=imread('cameraman.tif');
>> imshow(a)
>> imcontrast(gca)
**imcontrast tool will only work with grayscale images.
$ imcontrast(gca) will open a contrast image adjustment tool ...by which you c
an adjust contrast of image sliding the margins on histogram graph ion tool.
9] HISTOGRAM MATCHED:if you have 2 same but with different contrast images ..if both images's his
togram are matching then this command will adjust histogram of both imges.
it will plot only best area of histogram and neglect other areas.
Command is-
@@ [mn,mk]=imhistmatch(a,b);
ograms is matching.
*** we use it to crop an area from image... after executing this command a plu
s sign(+) will be shown...use that sign to crop the image and right click to cro
p image.
but if we dotn want to do it on image show figure window and iof we know pixel
value...then we can do it manually..by using following command:Eg. imcrop(71,123,234,12);
11] TO ROTATE THE IMAGE:
imrotate(image,angle);
this will rotate the image by given angle.
{ press ctrl+c to abort the execution mode of MATLAB);
11] MORPHOLOGY:- im image processing morphological operations are resize and re
shape of binary image. (logical means 0 and 1).
to do manipulations on image binary .. two types of operations
in morphology:*** image should be binary.
1) dillation .:command is : - imdilate(image name ,Sc);
is structure element (SE)=PARAMETERS WILL BE LENGTH AND ANGLE of text
2) errosion. :command is : -
here Sc