Mercurial > hg > nsaunier > traffic-intelligence
comparison c/cvutils.cpp @ 9:eb38637f338d
created cvutils
| author | Nicolas Saunier <nico@confins.net> |
|---|---|
| date | Sun, 08 Nov 2009 10:33:41 -0500 |
| parents | |
| children | e77e2fd69b02 |
comparison
equal
deleted
inserted
replaced
| 8:59b7e3954178 | 9:eb38637f338d |
|---|---|
| 1 #include "cvutils.hpp" | |
| 2 | |
| 3 #include "opencv/cv.h" | |
| 4 | |
| 5 #include <iostream> | |
| 6 | |
| 7 using namespace std; | |
| 8 | |
| 9 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} | |
| 10 | |
| 11 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { | |
| 12 IplImage* image = cvCreateImage(size, depth, channels); | |
| 13 | |
| 14 if (!image) { | |
| 15 cerr << "Error: Couldn't allocate image. Out of memory?\n" << endl; | |
| 16 exit(-1); | |
| 17 } | |
| 18 | |
| 19 return image; | |
| 20 } |
