diff options
author | Martin Miller | 2017-04-03 09:51:42 -0500 |
---|---|---|
committer | Martin Miller | 2017-04-03 09:51:42 -0500 |
commit | 05a04acf46a0a5624e019e4dc947cd3cd587a80b (patch) | |
tree | 1e2e6a6fda94d1a64c9f7bed5f160ae15da32e12 /tests | |
parent | 997967da8e01216b3c655613d875af30fdf2d0c8 (diff) | |
download | refslam-05a04acf46a0a5624e019e4dc947cd3cd587a80b.zip refslam-05a04acf46a0a5624e019e4dc947cd3cd587a80b.tar.gz |
Add drawMatches
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/drawMatches.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/drawMatches.py b/tests/drawMatches.py new file mode 100755 index 0000000..d369e16 --- /dev/null +++ b/tests/drawMatches.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python2.7 +# drawMatches.py +# Martin Miller +# Created: 2017/04/02 +"""Reads in a file of matches and plots them onto the image +Usage: drawMatches image matches +""" +import cv2 +import sys + +def main(): + imbayer = cv2.imread(sys.argv[1],-1) + im = cv2.cvtColor(imbayer, cv2.cv.CV_BayerBG2BGR,3) + + with open(sys.argv[2],'r') as fin: + for line in fin: + id,xs,ys,xr,yr = map(int,line.strip().split(',')) + cv2.circle(im,(xs,ys),4,(0,255,0),-1) + cv2.circle(im,(xr,yr),4,(0,0,255),-1) + cv2.imshow("Matches", im) + cv2.waitKey(0) + cv2.imwrite("matches.jpg",im) + +if __name__=='__main__': + main() + |