IP lab5ad

background image

1

Image processing

Laboratory 5 (ad)

Exercise 1

Try to analyse the histogram of the image mikolaj.jpg. The local maximum in this diagram results
from pixels of background. Choose the threshold below and above this maximum and compare the
results with the effect of Otsu algorithm.


Example 1
Binarization with 2 thresholds:

L = imread(

'portret.jpg'

);

imshow(zeros(600,800));

subplot(1,2,1),imshow(L);

subplot(1,2,2),imhist(L);

prompt = {

‘Choose the threshold value:’

,

’Choose the tolerance:’

};

odp = inputdlg(prompt);

prog = str2num(odp{1});

tol = str2num(odp{2});

L2 = (L<(prog+tol))&(L>(prog-tol));

figure;

imshow(L2);

Exercise 2

Modify the example above this way, that the user could click on the pixel of image and choose the
threshold (the value of threshold is equal the value of this pixel), and the tolerance should be
chosen in the dialog window.

Example 2
Animation of binarization::

L = imread(

'portret.jpg'

);

for

i=1:256

imshow(L>i);

pause(0.01);

end

;


Wyszukiwarka

Podobne podstrony:
Adresy IP
w8 VLAN oraz IP w sieciach LAN
ADRESACJA W SIECIACJ IP
SNMP (IP)
Adresy IP
ip 11 04
Microsoft PowerPoint IP tryb zgodnosci
CGEIB IP
ZAPROSZENIE, Documents, IP Zielona gora, mat inf
Podsumowanie pracy Zespołu Informacji Publicznej i Współpracy z innymi za rok 2015, Documents, ip, s
ip
Protokół TCP IP, R03 5
IP 2
Protokol TCP IP R08 5 id 834124 Nieznany
Bardzo krótko o TCP IP adresacja w sieciach lokalnych
Protokół TCP IP, R12 5
ip 31s

więcej podobnych podstron