view 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
line wrap: on
line source

#include "cvutils.hpp"

#include "opencv/cv.h"

#include <iostream>

using namespace std;

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);

  if (!image) {
    cerr << "Error: Couldn't allocate image.  Out of memory?\n" << endl;
    exit(-1);
  }

  return image;
}