Input: Two image A (source image) and B (target image);
Dense local descriptors FA of A and FB of B.
Output: Corresponding field T.
1: Divide A to the non-overlapping cells of size w×w and obtain the BoW histograms for each cell i.
2: Divide B to overlapping cells of size w×w with step size s and obtain the BoW histograms of each cell j.
3: Determine the most similar cell centered at (xB, yB) in B for each cell cA in A.
4: Set T(x, y)=(xB, yB) ((x, y)∈cA) for each cell cA in A and random permute of T.
5: Update T by field propagation as PatchMatch algorithm using the local descriptors FA and FB.
6: Update T by locally randomized search using the local descriptors FA and FB.
7: Repeat steps 5 and 6 a fixed number of times or until convergence.
Algorithm 1: Hierarchically dense matching.