Algorithm 1. Generating sparse matches.
| Input: I1, I2, a threshold ς |
| Output: a set of sparse patch matches |
| 1: Divide the image I1 into a set of small regions |
| 2: for each do |
| 3: for any region do |
| 4: set |
| 5: set |
| 6: end for |
| 7: end for |
| 8: Determine the optimal matching set |
| 9: for each do |
| 10: if then |
| 11: |
| 12: end if |
| 13: end for |