rawImageSizeCaptured camera handling

git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@67 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2011-06-07 15:17:45 +00:00
parent b54841c3da
commit b4446c3ddd
2 changed files with 4 additions and 2 deletions

View File

@@ -200,6 +200,7 @@ private:
// Usb camera
int _usbDevice;
bool _rawImageSizeCaptured;
};

View File

@@ -446,7 +446,8 @@ CameraVideo::CameraVideo(int usbDevice,
Camera(imageRate, autoRestart, imageWidth, imageHeight),
_capture(0),
_src(kUsbDevice),
_usbDevice(usbDevice)
_usbDevice(usbDevice),
_rawImageSizeCaptured(rawImageSizeCaptured)
{
}
@@ -484,7 +485,7 @@ bool CameraVideo::init()
{
ULOGGER_DEBUG("CameraVideo::init() Usb device initialization on device %d with imgSize=[%d,%d]", _usbDevice, getImageWidth(), getImageHeight());
_capture = cvCaptureFromCAM(_usbDevice);
if(_capture && getImageWidth() && getImageHeight())
if(_capture && getImageWidth() && getImageHeight() && !_rawImageSizeCaptured)
{
cvSetCaptureProperty(_capture, CV_CAP_PROP_FRAME_WIDTH, double(getImageWidth()));
cvSetCaptureProperty(_capture, CV_CAP_PROP_FRAME_HEIGHT, double(getImageHeight()));