UNIVERSITÀ DEGLI STUDI DI PARMA Studio e applicazione di ...
UNIVERSITÀ DEGLI STUDI DI PARMA Studio e applicazione di ...
UNIVERSITÀ DEGLI STUDI DI PARMA Studio e applicazione di ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
1.2. Algoritmi 17<br />
1.2.3 Algoritmo completamente incrementale<br />
L’algoritmo semi-incrementale presentato nel paragrafo 1.2.2 può essere trasformato<br />
in completamente incrementale, osservando che<br />
D(x,y,d) = D x [d] − E(x,y,d) + F(x,y,d) (1.17)<br />
con D x un vettore <strong>di</strong> <strong>di</strong>mensione max_k che, alla posizione d, memorizza il valore<br />
D(x − 1,y,d), mentre<br />
e<br />
E(x,y,d) = def<br />
|R[x − n − 1,y + m] − L[x − n − 1 + d,y + m]| (1.18)<br />
Questo significa che<br />
F(x,y,d) = def<br />
|R[x + n,y + m] − L[x + n + d,y + m]| (1.19)<br />
D(x,y,d) = D x [d] − E x [ ¯x,d] + F(x,y,d) (1.20)<br />
con ¯x = x mod (2n + 1), ed E x viene aggiornato con i valori <strong>di</strong> F(x,y,d) man mano<br />
che sono calcolati.<br />
Combinando l’equazione 1.20 con la 1.15, infine, si ottiene<br />
SAD(x,y,d) =<br />
SAD(x,y − 1,d) − C y [x,ȳ,d] +<br />
D x [d] − E x [ ¯x,d] + F(x,y,d) (1.21)<br />
che comporta che ogni SAD può essere ottenuta con un solo confronto tra pixel delle<br />
immagini sorgenti, corrispondente al termine F(x,y,d), in<strong>di</strong>pendentemente dalla <strong>di</strong>mensione<br />
della finestra. Si noti che il termine C y viene iterativamente aggiornato con<br />
il risultato <strong>di</strong> D x [d] − E x [ ¯x,d] + F(x,y,d).