From now on use NaoMover from motion.py

Also use `read_config` from `utils.py`
This commit is contained in:
2018-06-03 16:08:39 +02:00
parent cb649daa15
commit 5bd50de06e
13 changed files with 229 additions and 644 deletions

View File

@@ -1,10 +1,12 @@
import argparse
import cv2
from datetime import datetime
from utils import read_config
from imagereaders import NaoImageReader
import argparse
if __name__ == '__main__':
cfg = read_config()
parser = argparse.ArgumentParser()
parser.add_argument('--res', type=int, choices=(1, 2, 3),
default=3)
@@ -12,11 +14,11 @@ if __name__ == '__main__':
default=0)
args = parser.parse_args()
video = NaoImageReader('192.168.0.11', res=args.res, cam_id=args.cam_id,
video = NaoImageReader(cfg['ip'], res=args.res, cam_id=args.cam_id,
fps=1)
frame = video.get_frame()
video.close()
now = datetime.now().strftime('%Y%m%d%H%M%S')
prefix = 'bottom' if args.cam_id else 'bottom'
prefix = 'bottom' if args.cam_id else 'top'
cv2.imwrite(prefix + now + '.jpg', frame)