Mercurial Hosting > traffic-intelligence
changeset 906:a57e6fbcd8e3
minor
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 23 Jun 2017 00:03:17 -0400 |
parents | 0e017178f7ab |
children | 9fd7b18f75b4 |
files | scripts/extract-appearance-images.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/extract-appearance-images.py Thu Jun 22 23:40:16 2017 -0400 +++ b/scripts/extract-appearance-images.py Fri Jun 23 00:03:17 2017 -0400 @@ -55,7 +55,6 @@ [map1, map2] = cvutils.computeUndistortMaps(width, height, undistortedImageMultiplication, intrinsicCameraMatrix, distortionCoefficients) height, width = map1.shape -print(timeInterval) if capture.isOpened(): ret = True frameNum = timeInterval.first @@ -70,7 +69,9 @@ img = cv2.remap(img, map1, map2, interpolation=cv2.INTER_LINEAR) for obj in objects: if obj.existsAtInstant(frameNum): - if (10+frameNum-obj.getFirstInstant())%args.nFramesStep == 0: # todo find next non zero image if none + if (10+frameNum-obj.getFirstInstant())%args.nFramesStep == 0: + # todo find next non zero image if none + # todo get several images if different features (measure of similarity) croppedImg = cvutils.imageBox(img, obj, frameNum, invHomography, width, height, classifierParams.percentIncreaseCrop, classifierParams.percentIncreaseCrop, classifierParams.minNPixels) if croppedImg is not None: imsave(args.directoryName+os.sep+moving.userTypeNames[obj.getUserType()]+os.sep+args.imagePrefix+'-{}-{}.png'.format(obj.getNum(), frameNum), croppedImg)