TP-traitement-audio-visuel/TP11/appariement.m
2023-06-22 20:47:16 +02:00

26 lines
459 B
Matlab

function paires = appariement(pics_t, pics_f)
delta_t = 90;
delta_f = 90;
n_voisins = 5;
n_pics = length(pics_t);
paires = [];
for i=1:n_pics
f = pics_f(i);
t = pics_t(i);
voisins = find(pics_t > t & pics_t <= t + delta_t & pics_f >= f - delta_f & pics_f <= f + delta_f, n_voisins);
for voisin=voisins'
paires = [paires ; f pics_f(voisin) t pics_t(voisin)];
end
end
end