47 #include <visp/vpOpenCVGrabber.h>
49 #if defined(VISP_HAVE_OPENCV)
51 #include <visp/vpImageConvert.h>
52 #include <visp/vpFrameGrabberException.h>
61 : capture(NULL), DeviceType(0), flip(false)
88 capture = cvCreateCameraCapture(DeviceType);
99 "Initialization not done : camera already used or no camera found") );
148 "Initialization not done") );
151 cvGrabFrame(capture);
152 im = cvRetrieveFrame(capture);
172 "Initialization not done") );
175 cvGrabFrame(capture);
176 im = cvRetrieveFrame(capture);
196 "Initialization not done") );
199 cvGrabFrame(capture);
200 im = cvRetrieveFrame(capture);
210 cvReleaseCapture( &capture );
223 framerate = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
235 cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, framerate);
251 if ( cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, w))
256 "Impossible to set the size of the grabber") );
274 if ( cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, h))
279 "Impossible to set the size of the grabber") );
303 if ( DeviceType != 0 && DeviceType != 100 &&DeviceType != 200 && DeviceType != 300)
305 vpTRACE(
"The expected type of device may be unknown.");
void setDeviceType(int type)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void setFlip(bool flipType)
void setHeight(const unsigned int height)
Error that can be emited by the vpFrameGrabber class and its derivates.
void setWidth(const unsigned int width)
unsigned int height
Number of rows in the image.
void setFramerate(const double framerate)
bool init
Set to true if the frame grabber has been initialized.
void getFramerate(double &framerate)
unsigned int width
Number of columns in the image.