9
|
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 }
|