diff c/cvutils.cpp @ 614:5e09583275a4

Merged Nicolas/trafficintelligence into default
author Mohamed Gomaa <eng.m.gom3a@gmail.com>
date Fri, 05 Dec 2014 12:13:53 -0500
parents 1e3c7fe21a38
children d3e8dd9f3ca4 8ac7f61c6e4f
line wrap: on
line diff
--- a/c/cvutils.cpp	Thu Apr 18 15:29:33 2013 -0400
+++ b/c/cvutils.cpp	Fri Dec 05 12:13:53 2014 -0500
@@ -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(),
@@ -87,14 +87,15 @@
 				Colors::white(), 
 				Colors::black()};
 
+// Blue, Green, Red
 Scalar Colors::black(void) { return Scalar(0,0,0);}
-Scalar Colors::red(void) { return Scalar(255,0,0);}
+Scalar Colors::blue(void) { return Scalar(255,0,0);}
 Scalar Colors::green(void) { return Scalar(0,255,0);}
-Scalar Colors::blue(void) { return Scalar(0,0,255);}
+Scalar Colors::red(void) { return Scalar(0,0,255);}
 Scalar Colors::white(void) { return Scalar(255,255,255);}
 Scalar Colors::magenta(void) { return Scalar(255,0,255);}
-Scalar Colors::cyan(void) { return Scalar(0,255,255);}
-Scalar Colors::yellow(void) { return Scalar(255,255,0);}
+Scalar Colors::yellow(void) { return Scalar(0,255,255);}
+Scalar Colors::cyan(void) { return Scalar(255,255,0);}
 
 Scalar Colors::color3(const int& num) { return Colors::color[num%3];}
 Scalar Colors::color8(const int& num) { return Colors::color[num%Colors::nColors];}