Skip to content

Instantly share code, notes, and snippets.

@appoll
Created July 23, 2018 13:33
Show Gist options
  • Save appoll/d5811ee564dd85f55a9fa299f0d64143 to your computer and use it in GitHub Desktop.
Save appoll/d5811ee564dd85f55a9fa299f0d64143 to your computer and use it in GitHub Desktop.
Homography estimation normalization
### normalization so that the points have zero mean and unit standard deviation - important for numerical reasons
m = np.mean(input_points[:2], axis=1)
maxstd = max(np.std(input_points[:2], axis=1)) + 1e-9
C1 = np.diag([1/maxstd, 1/maxstd, 1])
C1[0][2] = -m[0]/maxstd
C1[1][2] = -m[1]/maxstd
input_points = np.dot(C1, input_points)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment