Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/classify-objects.py @ 904:8f60ecfc2f06
work in progress, almost ready
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 22 Jun 2017 18:08:46 -0400 |
| parents | c69a8defe5c3 |
| children | 0e017178f7ab |
comparison
equal
deleted
inserted
replaced
| 903:81ee5aaf213d | 904:8f60ecfc2f06 |
|---|---|
| 69 | 69 |
| 70 capture = cv2.VideoCapture(videoFilename) | 70 capture = cv2.VideoCapture(videoFilename) |
| 71 width = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) | 71 width = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) |
| 72 height = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)) | 72 height = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)) |
| 73 | 73 |
| 74 if undistort: # setup undistortion | |
| 75 [map1, map2] = cvutils.computeUndistortMaps(width, height, undistortedImageMultiplication, intrinsicCameraMatrix, distortionCoefficients) | |
| 76 | |
| 74 pastObjects = [] | 77 pastObjects = [] |
| 75 currentObjects = [] | 78 currentObjects = [] |
| 76 if undistort: # setup undistortion | |
| 77 [map1, map2] = cvutils.computeUndistortMaps(width, height, undistortedImageMultiplication, intrinsicCameraMatrix, distortionCoefficients) | |
| 78 if capture.isOpened(): | 79 if capture.isOpened(): |
| 79 ret = True | 80 ret = True |
| 80 frameNum = timeInterval.first | 81 frameNum = timeInterval.first |
| 81 capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, frameNum) | 82 capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, frameNum) |
| 82 lastFrameNum = timeInterval.last | 83 lastFrameNum = timeInterval.last |
