# HG changeset patch # User Nicolas Saunier # Date 1315346106 14400 # Node ID 4af774bb186dd55479b5c6d8bf2a0df188ded6ae # Parent 404f3cade05fcefe073de2b31ffc9b187959b510 wrote a simple script to compute homography from point correspondences and display the reprojection for visual verification diff -r 404f3cade05f -r 4af774bb186d python/compute-homography.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/compute-homography.py Tue Sep 06 17:55:06 2011 -0400 @@ -0,0 +1,40 @@ +#! /usr/bin/env python + +import sys,getopt + +import numpy as np +import cv2 + +import cvutils +import utils + +options, args = getopt.getopt(sys.argv[1:], 'h',['help','video_frame=']) +options = dict(options) + +if '--help' in options.keys() or '-h' in options.keys(): + print('''The argument should be the name of a file containing at least 4 non-colinear point coordinates: + - the first two lines are the x and y coordinates in the projected space (usually world space) + - the last two lines are the x and y coordinates in the origin space (usually image space)''') + sys.exit() + +if len(args) == 0: + print('Usage: {0} --help|-h [--video_frame