Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

University of Aleppo

Faculty of Electrical and Electronic Engineering



Computer Engineer Section
/3 / " # $%

:imhist
grayscale indexed
*+ ", :() . ! " # $ %&
.. *+ %/ 0 1. %& 2
% # $ %6 *+ * * ( ) , n .1 3" imhist . %&
.* + * 1 $6 #) && 7
. : 2 3& 1 ; < 100 * 8 9 * )
, = 6
I = imread('rice.png');
imshow(I)
#) ,
figure, imhist(I)

:
>, 0? & * @& * 0 A$ ( # / B : 1% C
(/ ) CA && D) 9 & * @& E *0 (< +1 F C ) < +1
.# ;
.& &+ * + 1 #) %6% # / B G& , 1 /
:*
I=imread('pout.tif');
subplot(1,2,1);
imshow(I)

)1) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

subplot(1,2,2);
imhist(I,64)

* 1 %/ . & ? *+ & $A + %/ . + )
. & % / [0-255] * +
: *+ : H) B
:* + && : %6 1 .1
imadjust . %6 *+ && B" %6 1 •
:*
I=imread('pout.tif');
J=imadjust(I); % $%&' ()%* +,- $%&' .*/0 1 '23
subplot(1,2,1);
imshow(J)
subplot(1,2,2);
imhist(J,64)

)2) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

imadjust . % $0 : I * & *+ && •


*+ & & 1% # $ @ F2 1J0 / && $0 %/
. @ 7 ( %6
J = imadjust(I,[low_in; high_in],[low_out; high_out])
: % / ( %6 1 :
.* & %6& & $ *+ B" ; 9 (1)
imadjust . $0 1 1J0 * + = +K & & B & & (2)
:*
I=imread('cameraman.tif');
J=imadjust(I,[0 0.2],[0.5 1]);
subplot(1,2,1);
imshow(I)
subplot(1,2,2);
imshow(J)

. * truecolor ) ; 1 •
:*
RGB1 = imread('football.jpg');
RGB2 = imadjust(RGB1,[.2 .3 0; .6 .7 1],[]);
subplot(1,2,1);
imshow(RGB1),
subplot(1,2,2);
imshow(RGB2)

)3) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

. $0 = +K % / L" & $ 3" stretchlim . %& •


imadjust
:*
I=imread('rice.png');
J=imadjust(I,stretchlim(I),[0 1]);
ED •
1, * 0 low-high %/ 1 1 * 0 % / imadjust .
I * & %/ 6)$ *$+ 3" [0 inf] E 6 . .
E

:*
[x,map]=imread('forest.tif');
I=ind2gray(x,map);
J=imadjust(I,[],[],0.5);
subplot(1,2,1);
imshow(I)
subplot(1,2,2);
imshow(J)

)4) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

: 3 %& %6 1 .2
:*
I = imread('tire.tif');
J = histeq(I);
subplot(2,2,1);
imshow(I)
subplot(2,2,2);
imshow(J)
subplot(2,2,3);
imhist(I,64)
subplot(2,2,4);
imhist(J,64)

@A 3 %& %6 1 .3
:*
I=imread('pout.tif');
J=adapthisteq (I);
subplot(1,2,1);
imshow(J)

)5) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

subplot(1,2,2);
imhist(J,64)

! "# $
H ,< +1 C K K 6 : 6 < +1 & % C
, // # 8$ ! * %/ + .A1 = N + < +1
: =0, C > & $ > , < +1 * & 3&9 7 & B
< +1 & %C # O P 1 % Q > # # ", •
.% C 1 + K0 < +1
CCD 8 * # $ 2 O * +& + 0 # # ", •
.< +1 7
.< +1 7 # $ ! */ •
: < +1 ?: H) B
filter2 : D0 %& < +1 , .1
average , Gaussian # 0 < +1 $ O D0 " % /

)6) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

.R$ + #) *&$ + +1 * * F $ average &A $ D0 % / H


. E C # < +1 *
:*
I = imread('eight.tif');
subplot(1,2,1);
imshow(I)
J = imnoise(I,'salt & pepper',0.02);
subplot(1,2,2);
imshow(J)

K = filter2(fspecial('average',3),J)/255;
figure, imshow(K)

)7) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

Median Filter : D0 %& < +1 , .2


+ #) / " % average &A $ D0 R 0 D0
. 1 FC & A %/ , *1 ; D0 "
D0 % / : * 8C *+ :*

L = medfilt2(J,[3 3]);
figure, imshow(L)

wiener2 :@A D0 %& < +1 , .3


@A D0 H D0 *1 <P $ # 0
. $ # && = + @ D0 (
:*
RGB = imread('saturn.png');
I = rgb2gray(RGB);
subplot(1,2,1);
Imshow(I);
J = imnoise(I,'gaussian',0,0.025);
subplot(1,2,2);
imshow(J)

)8) &' '(


University of Aleppo
Faculty of Electrical and Electronic Engineering

Computer Engineer Section
/3 / " # $%

K = wiener2(J,[5 5]);
figure, imshow(K)

)9) &' '(

You might also like