47 #include <visp/vpOpenCVGrabber.h>
49 #if defined(VISP_HAVE_OPENCV)
51 #include <visp/vpImageConvert.h>
52 #include <visp/vpFrameGrabberException.h>
92 capture = cvCreateCameraCapture(DeviceType);
103 "Initialization not done : camera already used or no camera found") );
152 "Initialization not done") );
155 cvGrabFrame(capture);
156 im = cvRetrieveFrame(capture);
176 "Initialization not done") );
179 cvGrabFrame(capture);
180 im = cvRetrieveFrame(capture);
200 "Initialization not done") );
203 cvGrabFrame(capture);
204 im = cvRetrieveFrame(capture);
214 cvReleaseCapture( &capture );
227 framerate = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
239 cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, framerate);
255 if ( cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width))
260 "Impossible to set the size of the grabber") );
278 if ( cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, height))
283 "Impossible to set the size of the grabber") );
307 if ( DeviceType != 0 && DeviceType != 100 &&DeviceType != 200 && DeviceType != 300)
309 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.