Mercurial Hosting > traffic-intelligence
changeset 429:2be846d36dec
reverted to stable OpenCV release 2.4.6
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 12 Nov 2013 00:38:47 -0500 |
parents | 70accfa6692f |
children | fb3654a9127d |
files | c/InputVideoFileModule.cpp include/InputVideoFileModule.h python/cvutils.py |
diffstat | 3 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/c/InputVideoFileModule.cpp Tue Nov 05 23:42:28 2013 -0500 +++ b/c/InputVideoFileModule.cpp Tue Nov 12 00:38:47 2013 -0500 @@ -6,8 +6,8 @@ { mInit = mVideoCapture.open(videoPath.c_str()); double frameCount; - frameCount = mVideoCapture.get(cv::CAP_PROP_FRAME_COUNT); - mSize = cv::Size(mVideoCapture.get(cv::CAP_PROP_FRAME_WIDTH), mVideoCapture.get(cv::CAP_PROP_FRAME_HEIGHT)); + frameCount = mVideoCapture.get(CV_CAP_PROP_FRAME_COUNT); + mSize = cv::Size(mVideoCapture.get(CV_CAP_PROP_FRAME_WIDTH), mVideoCapture.get(CV_CAP_PROP_FRAME_HEIGHT)); mNumberOfFrame = (unsigned int)frameCount; } @@ -15,7 +15,7 @@ void InputVideoFileModule::setFrameNumber(const unsigned int& frameNumber) { - mVideoCapture.set(cv::CAP_PROP_POS_FRAMES, frameNumber); + mVideoCapture.set(CV_CAP_PROP_POS_FRAMES, frameNumber); } bool InputVideoFileModule::getNextFrame(cv::Mat& outputPicture)
--- a/include/InputVideoFileModule.h Tue Nov 05 23:42:28 2013 -0500 +++ b/include/InputVideoFileModule.h Tue Nov 12 00:38:47 2013 -0500 @@ -4,7 +4,7 @@ #include "InputFrameProviderIface.h" #include <string> #include "opencv2/core/core.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/highgui/highgui.hpp" class InputVideoFileModule : public InputFrameProviderIface {
--- a/python/cvutils.py Tue Nov 05 23:42:28 2013 -0500 +++ b/python/cvutils.py Tue Nov 12 00:38:47 2013 -0500 @@ -122,7 +122,7 @@ key = -1 ret = True frameNum = firstFrameNum - capture.set(cv2.CAP_PROP_POS_FRAMES, firstFrameNum) + capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, firstFrameNum) while ret and not quitKey(key): ret, img = capture.read() if ret: @@ -130,7 +130,7 @@ print('frame {0}'.format(frameNum)) frameNum+=1 if text != None: - cv2.putText(img, text, (10,50), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) + cv2.putText(img, text, (10,50), cv2.cv.CV_FONT_HERSHEY_PLAIN, 1, cvRed) cvImshow('frame', img, rescale) key = cv2.waitKey(wait) cv2.destroyAllWindows() @@ -141,9 +141,9 @@ images = [] capture = cv2.VideoCapture(videoFilename) if capture.isOpened(): - nDigits = int(floor(log10(capture.get(cv2.CAP_PROP_FRAME_COUNT))))+1 + nDigits = int(floor(log10(capture.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))))+1 ret = False - capture.set(cv2.CAP_PROP_POS_FRAMES, firstFrameNum) + capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, firstFrameNum) imgNum = 0 while imgNum<nFrames: ret, img = capture.read() @@ -166,7 +166,7 @@ def getFPS(videoFilename): capture = cv2.VideoCapture(videoFilename) if capture.isOpened(): - fps = capture.get(cv2.CAP_PROP_FPS) + fps = capture.get(cv2.cv.CV_CAP_PROP_FPS) capture.release() return fps else: @@ -205,13 +205,13 @@ from moving import userTypeNames capture = cv2.VideoCapture(videoFilename) - width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH)) - height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT)) + width = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) + height = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)) if capture.isOpened(): key = -1 ret = True frameNum = firstFrameNum - capture.set(cv2.CAP_PROP_POS_FRAMES, firstFrameNum) + capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, firstFrameNum) if not lastFrameNumArg: from sys import maxint lastFrameNum = maxint @@ -239,7 +239,7 @@ objDescription = '{} '.format(obj.num) if userTypeNames[obj.userType] != 'unknown': objDescription += userTypeNames[obj.userType][0].upper() - cv2.putText(img, objDescription, obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.FONT_HERSHEY_PLAIN, 1, cvRed) + cv2.putText(img, objDescription, obj.projectedPositions[frameNum-obj.getFirstInstant()].asint().astuple(), cv2.cv.CV_FONT_HERSHEY_PLAIN, 1, cvRed) cvImshow('frame', img, rescale) key = cv2.waitKey() if saveKey(key):