view c/cvutils.cpp @ 10:068cf45c3f1b

added optical flow skeleton (test to reach a frame with cvqueryframe (fast for small resolutions)
author Nicolas Saunier <nico@confins.net>
date Mon, 09 Nov 2009 01:56:25 -0500
parents eb38637f338d
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;
}