| 1: Read frames L(n × m) and R(n × m) |
| 2: Set template size: template(n × n) |
| 3: Select the template in Left Image: |
| 4: Initialize template T |
| 5: Compute row means of T |
| 6: Compute template relationship array Tr from T |
| 7: Search for Similarity in Right Image: |
| 8: Initialize best match variable:minDissimilav rity |
| 9: Select parallel rows Rc(n × m) on the R(n × m) 10: Compute column means of the matrix Rcn × m |
| 11: Compute Relationship array Rr from Rc |
| 12: for i = 0; length(Rr); i++ do |
| 13: Dissimilarity[i] = Tr(i)-Rr(i) |
| 14: Best Match position: |
| 15: Row = get rows of Rr |
| 16: Column = min(Dissimilarity) + n/2 |