# HG changeset patch # User Nicolas Saunier # Date 1341809164 14400 # Node ID be3761a09b20ece2970d50fbba425db5abea97a4 # Parent 6774bdce03f157c5f91f84f5b55e8ea597e5ff11 added functions to input point correspondences diff -r 6774bdce03f1 -r be3761a09b20 python/compute-homography.py --- a/python/compute-homography.py Fri Jul 06 01:08:38 2012 -0400 +++ b/python/compute-homography.py Mon Jul 09 00:46:04 2012 -0400 @@ -2,13 +2,14 @@ import sys,getopt +import matplotlib.pyplot as plt import numpy as np import cv2 import cvutils import utils -options, args = getopt.getopt(sys.argv[1:], 'h',['help','video_frame=']) +options, args = getopt.getopt(sys.argv[1:], 'hp:i:w:n:u:',['help']) options = dict(options) # TODO process camera intrinsic and extrinsic parameters to obtain image to world homography, taking example from Work/src/python/generate-homography.py script @@ -51,29 +52,71 @@ # cvFindHomography(imagePoints, worldPoints, H); +if '--help' in options.keys() or '-h' in options.keys() or len(options) == 0: + print('Usage: {0} --help|-h [-p point-correspondences.txt] [ -i video-frame] [ -w world-frame] [n number-points] [-u unit-per-pixel=1]'.format(sys.argv[0])) + print('''The input data can be provided either as point correspondences already saved + in a text file or inputed by clicking a certain number of points (>=4) + in a video frame and a world image. -if '--help' in options.keys() or '-h' in options.keys() or len(args) == 0: - print('Usage: {0} --help|-h [--video_frame