Mercurial Hosting > traffic-intelligence
changeset 407:5eeb3b9fb568
commented problem code (opencv 2.4.6)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 12 Aug 2013 22:50:42 -0400 |
parents | 37c7b46f6e21 |
children | 365d8dee44f3 |
files | c/cvutils.cpp include/cvutils.hpp |
diffstat | 2 files changed, 26 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/c/cvutils.cpp Wed Aug 07 11:42:34 2013 -0400 +++ b/c/cvutils.cpp Mon Aug 12 22:50:42 2013 -0400 @@ -49,34 +49,34 @@ pts.push_back(kpts[i].pt); } -IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} +// IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} -IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { - IplImage* image = cvCreateImage(size, depth, channels); +// IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { +// IplImage* image = cvCreateImage(size, depth, channels); - if (!image) { - cerr << "Error: Couldn't allocate image. Out of memory?\n" << endl; - exit(-1); - } +// if (!image) { +// cerr << "Error: Couldn't allocate image. Out of memory?\n" << endl; +// exit(-1); +// } - return image; -} +// return image; +// } -int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum) { - int frameNum = currentFrameNum; - if (currentFrameNum > targetFrameNum) { - cerr << "Current frame number " << currentFrameNum << " is after the target frame number " << targetFrameNum << "." << endl; - } else if (currentFrameNum < targetFrameNum) { - IplImage* frame = cvQueryFrame(inputVideo); - frameNum++; - while (frame && frameNum<targetFrameNum) { - frame = cvQueryFrame(inputVideo); - frameNum++; - } - } +// int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum) { +// int frameNum = currentFrameNum; +// if (currentFrameNum > targetFrameNum) { +// cerr << "Current frame number " << currentFrameNum << " is after the target frame number " << targetFrameNum << "." << endl; +// } else if (currentFrameNum < targetFrameNum) { +// IplImage* frame = cvQueryFrame(inputVideo); +// frameNum++; +// while (frame && frameNum<targetFrameNum) { +// frame = cvQueryFrame(inputVideo); +// frameNum++; +// } +// } - return frameNum; -} +// return frameNum; +// } const Scalar Colors::color[] = {Colors::red(), Colors::green(),
--- a/include/cvutils.hpp Wed Aug 07 11:42:34 2013 -0400 +++ b/include/cvutils.hpp Mon Aug 12 22:50:42 2013 -0400 @@ -23,14 +23,14 @@ void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); /** Allocates a new IplImage. */ -IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels); +// IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels); -IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); +// IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); /** Goes to the target frame number, by querying frame, supposing the video input is currently at current frame number. Returns the frame number that was reached.*/ -int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum); +// int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum); /// Pre-defined colors class Colors {