Dip Assignment Project
Dip Assignment Project
DENCYUNI
VERSI
TY
SCHOOLOFENGI
NEERI
NG
DEPARTMENTOFELECTRONI
CSANDCOMMUNI
CATI
ONENGI
NEERI
NGYEAR2019-
20(
ODD
SEMESTER)
TI
TLE:
ImagePr
ocessi
ngusi
ngMATLAB(
Act
iveLear
ning)
St
affI
n-char
ge:
Nat
ya.
S Subj
ect
:Di
git
alI
magePr
ocessi
ng(
ECE307)
Sl
.No. StudentName Rol
lNumber
1. MohammedRayyanAhmed 20171ECE0174
2. MohammedSaquibAbbas 20171ECE0175
Sl
. Pr
ogr
am Ti
tl
e
No.
1. Ext
ract
ingI
mageI
nfor
mat
ion
(
Fil
ename,
Fi
leModi
fi
cat
ionDat
e,Fi
l
eSi
ze,
Widt
h,Hei
ght
,Bi
tDept
h,Col
orTy
peet
c.,
)
2. Conv
ert
ingCol
orI
maget
oGr
ayI
mageandBl
ack&Whi
teI
mage
3. Per
for
mingAr
it
hmet
icOper
ati
on:
ImageAddi
ti
on
4. Per
for
mingAr
it
hmet
icOper
ati
on:
ImageSubt
ract
ion
5. Per
for
mingAr
it
hmet
icOper
ati
on:
Mul
ti
pli
cat
ionandDi
vi
siononani
mage
6. Per
for
mingLogi
cal
Oper
ati
on:
ImageNegat
ion
7. Per
for
mingLogar
it
hmi
cTr
ansf
ormat
iononanI
mage
8. Per
for
mingPower
-LawTr
ansf
ormat
iononanI
mage
9. Per
for
mingCont
rastSt
ret
chi
ngonanI
mage
Per
for
mingHi
stogr
am Equal
i
zat
iononanI
mage
Page1of12
PRESI
DENCYUNI
VERSI
TY
1.EXTRACTI
NGI
MAGEI
NFORMATI
ON
cl
earal
l
;
cl
oseal
l;
cl
c;
pi
c=imfinf o('
C:\User s\ Admin\
Downl oads\house.
jpg'
);
i
mage_ name=pi c.Filename
modifi
cat ion_dat e=pi c.Fil
eModDat e
i
mage_ size=pi c.FileSi ze
i
mage_ wi dth=pic. Wi dt h
i
mage_ hei ght=pi c.
Hei ght
col
or_dept h=pic. BitDept h
col
or_type=pi c.Col orTy pe
Sample_ number =pi c.Number OfSampl es
codi
ng_met hod=pi c.Codi ngMethod
codi
ng_pr ocess=pi c. CodingProcess
Page2of12
PRESI
DENCYUNI
VERSI
TY
CONVERTI
NGCOLORI
MAGETOGRAYI
MAGEANDBLACK&WHI
TEI
MAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
origi
nal=imr ead('
C:\User s\Admi n\Downl
oads\ green.
jpg'
);
subplot(1,3,1) ;
i
mshow( or i
ginal);
ti
tle(
'Original Image' );
gray_scal e=r gb2gray (original
);
subplot(1,3, 2);
i
mshow( gr ay_scale);
ti
tle(
'GrayI mage' )
;
black_whi te=i m2bw( ori
gi nal)
;
subplot(1,3, 3);
i
mshow( black_ white) ;
ti
tle(
'Bl
ackandWhi teI mage' )
;
i
mwr i
te(gr ay _scal
e,'D:\newgr ay _
scale.
jpg'
,'
jpg'
);
i
mwr i
te(bl ack_ white,'
D:\newbl ack_whit
e.jpg',
'
jpg')
;
Page3of12
PRESI
DENCYUNI
VERSI
TY
3.PERFORMI
NGARI
THMETI
COPERATI
ON:
IMAGEADDI
TION
cl
earal
l
;
cl
oseal
l;
cl
c;
i
mage_ one=i mr ead('
C:\
User s\Admin\
Desktop\Kr
it
i\
DIP\
3.j
pg'
);
subpl
ot (
1,3,1);
i
mshow( image_ one);
ti
tl
e('
fir
sti mage' )
;
i
mage_ t
wo=i mr ead(
'C:
\ Users\Admin\Deskt
op\Kri
ti
\DI
P\4.j
pg'
)
;subplot(1,3,2)
;
i
mshow( image_ two);
ti
tl
e('
secondi mage' );
Add_Image=i mage_ one+image_ two;
subplot(1,3,3);
i
mshow( Add_ I
mage) ;
ti
tl
e('
imageaf t
eraddi t
ion')
;
Page4of12
PRESI
DENCYUNI
VERSI
TY
4.PERFORMI
NGARI
THMETI
COPERATI
ON:
IMAGESUBTRACTI
ON
cl
earal
l
;
cl
oseal
l;
cl
c;
i
mage_ one=i mr ead('
C:\Users\Admin\
Desktop\Kr
it
i\
DIP\
3.j
pg'
);
subpl
ot (
1,3,1);
i
mshow( image_ one);
ti
tl
e('
fir
sti mage' )
;
i
mage_ t
wo=i mr ead(
'C:\Users\Admin\Deskt
op\Kri
ti
\DI
P\4.j
pg'
)
;subplot(1,3,2);
i
mshow( image_ two);
ti
tl
e('
secondi mage' );
Subtracted_ Image=image_ one-i
mage_ t
wo;
subplot(1,3,3);
i
mshow( Subt racted_Image) ;
ti
tl
e('
imageaf t
ersubt r
act i
on');
Page5of12
PRESI
DENCYUNI
VERSI
TY
PERFORMI
NGARI
THMETI
COPERATI
ON:
MULTI
PLI
CATI
ONANDDI
VISI
ON
ONANIMAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
i
nput=imread( 'C:\
User s\Admin\Downloads\
frui
tbowl
.
j
pg')
;subpl ot(2,2,
1);
i
mshow( input );
ti
tl
e('
Ori
ginal I
mage' )
;
i
mage_ mul ti
plicati
on=i mmulti
ply(
input
,2.
5);
subpl
ot(2,2,2);
i
mshow( image_ multipli
cati
on);
ti
tl
e('
I
mageMul ti
pli
cation'
);
i
mage_ division=imdivide(i
nput,
2);
subpl
ot(2,2,3);
i
mshow( image_ divi
sion);
ti
tl
e('
I
mageDi visi
on')
;
Page6of12
PRESI
DENCYUNI
VERSI
TY
6.PERFORMI
NGLOGI
CALOPERATI
ON:
IMAGENEGATI
ON
cl
earal
l
;
cl
oseal
l;
cl
c;
ori
ginal=imr ead('
C:\User
s\Admin\Downloads\cat
.j
pg'
)
;subplot(1,3,1);
i
mshow( or i
ginal)
;
ti
tl
e('
Or i
ginal Image');
gray_scale=r gb2gray(
ori
ginal
);
subplot(1,3,2);
i
mshow( gr ay_scal
e);
ti
tl
e('
Gr ayI mage');
compl ement _i
mage=imcompl ement(
gray_scal
e);
subplot(1,3,3);
i
mshow( compl ement_i
mage);
ti
tl
e('
compl ementi mage')
;
Page7of12
PRESI
DENCYUNI
VERSI
TY
7.PERFORMI
NGLOGARI
THMI
CTRANSFORMATI
ONONANI
MAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
ori
ginal=imr ead( 'C:\User s\Admin\
Downloads\
images.
jpg
'
);subplot (
2, 2, 1);
i
mshow( or iginal );
ti
tl
e('
Or i
ginal Image' );
gray_scale=r gb2gr ay(ori
ginal)
;
subplot(2,2,2) ;
i
mshow( gr ay _ scale) ;
ti
tl
e('
Gr ayI mage' );
double_val ue=i m2doubl e(gray
_scale)
;
subplot(2,2,3) ;
i
mshow( doubl e_ value);
ti
tl
e('
Doubl eI mage' )
;
l
ogtransf =2* log( 1+doubl e_val
ue);
subplot(2,2,4) ;
i
mshow( logt r ansf );
ti
tl
e('
LogTr ansf ormat ion')
;
Page8of12
PRESI
DENCYUNI
VERSI
TY
8.PERFORMI
NGPOWER-
LAW TRANSFORMATI
ONONANI
MAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
ori
ginal=imr ead( '
C:\Users\ Admi n\Downloads\
.j
pg'
)
;subplot(3,3,1);
i
mshow( gr ay_scale) ;
ti
tl
e('
Gr ayI mage' );
gray_scale=r gb2gr ay(or
iginal)
;
subplot(3,3,2);
i
mshow( gr ay_scale) ;
ti
tl
e('
Gr ayI mage' );
double_val ue=im2doubl e(gray_scale);
subplot(3,3,3);
i
mshow( doubl e_ value);
ti
tl
e('
Doubl eVal ue');
power _l
aw=1* (doubl e_val
ue. ^
0.5) ;
subplot(3,3,4);
i
mshow( power _law) ;
ti
tl
e('
G=0. 5');
power _l
aw1=1* (doubl e_value.^
1. 5);
subplot(3,3,5);
i
mshow( power _law1) ;
ti
tl
e('
G=1. 5');
power _l
aw2=1* (doubl e_value.^
8) ;
subplot(3,3,6);
i
mshow( power _law2) ;
ti
tl
e('
G=8' );
Page9of12
PRESI
DENCYUNI
VERSI
TY
9.PERFORMI
NGCONTRASTSTRETCHI
NGONANI
MAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
ori
ginal=imread('C:
\Users\Admi n\Downl
oads\gr
een.
jpg'
);
subplot(3,1,
1);
i
mshow( ori
ginal);
ti
tl
e('OriginalImage' )
;
contrast=imadj ust(ori
ginal
,
stretchli
m(or
igi
nal,
[
0.050.95]
),
[]
);
subplot(3,1,2);
i
mshow( contrast)
;
ti
tl
e('cont r
astst r
etchedi mage');
Page10of12
PRESI
DENCYUNI
VERSI
TY
10.PERFORMI
NGHI
STOGRAM EQUALI
ZATI
ONONANI
MAGE
cl
earal
l
;
cl
oseal
l;
cl
c;
ori
ginal
=imread('
C:\
User
s\Admi
n\Deskt
op\
Kri
ti
\DI
P\PU.
jpg'
);
subplot
(2,
2,1);
i
mshow( ori
ginal)
;
ti
tl
e('
Ori
ginalImage'
);
gray_scale=rgb2gr
ay(
origi
nal
);
subplot(2,2,
2);
i
mhi st(
gr ay_
scale)
;
ti
tl
e('Hi
st ogr
am ofOri
ginalI
mage'
);
IH=hi
steq(gray
_scal
e);
subpl
ot(2,2,
3);
i
mshow( IH);
ti
tl
e('
Histogr
am Equali
zat
ion'
);
subplot(
2,2,
4);
i
mhi st(
IH);
ti
tl
e('Hi
stogram ofEqual
i
zat
ion'
);
Page11of12
PRESI
DENCYUNI
VERSI
TY
ss
Page12of12