| Algorithm 2. Mismatch Elimination Based on Matching Direction |
| 1. Calculate the matching direction of each match. |
| 2. Encode every match using its matching direction. |
| 3. For every code, count the number of matches with this code to create the histogram of matching direction. |
| 4. Find the maximum value of histogram and the secondary maximum value . |
| 5. If , save the matches with code of the maximum; otherwise, abandon all. |