-
Notifications
You must be signed in to change notification settings - Fork 0
/
afficherSeam.m
43 lines (37 loc) · 908 Bytes
/
afficherSeam.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function [ ] = afficherSeam( I,Hrz )
%AFFICHERSEAM Summary of this function goes here
% Detailed explanation goes here
R = I(:,:,1) ; % REd
G = I(:,:,2) ; % Green
B = I(:,:,3) ; % Blue
[L,C]=size(I);
if(Hrz)
%%Programation Dynamique
P=HprogD(R);
%%
%Chemin
S=Hseam(P);
for i=1:L
j=S(i);
G(i,j)=0;
B(i,j)=0;
end
E = reshape ([R G B], size(R,1), size(R,2), 3) ;
U=uint8(E);
imshow(U);
else
%%Programation Dynamique
P=VprogD(R);
%%
%Chemin
S=Vseam(P);
for i=1:L
j=S(i);
G(i,j)=0;
B(i,j)=0;
end
E = reshape ([R G B], size(R,1), size(R,2), 3) ;
U=uint8(E);
imshow(U);
end
end