mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
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:
@@ -200,6 +200,7 @@ private:
|
|||||||
|
|
||||||
// Usb camera
|
// Usb camera
|
||||||
int _usbDevice;
|
int _usbDevice;
|
||||||
|
bool _rawImageSizeCaptured;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -446,7 +446,8 @@ CameraVideo::CameraVideo(int usbDevice,
|
|||||||
Camera(imageRate, autoRestart, imageWidth, imageHeight),
|
Camera(imageRate, autoRestart, imageWidth, imageHeight),
|
||||||
_capture(0),
|
_capture(0),
|
||||||
_src(kUsbDevice),
|
_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());
|
ULOGGER_DEBUG("CameraVideo::init() Usb device initialization on device %d with imgSize=[%d,%d]", _usbDevice, getImageWidth(), getImageHeight());
|
||||||
_capture = cvCaptureFromCAM(_usbDevice);
|
_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_WIDTH, double(getImageWidth()));
|
||||||
cvSetCaptureProperty(_capture, CV_CAP_PROP_FRAME_HEIGHT, double(getImageHeight()));
|
cvSetCaptureProperty(_capture, CV_CAP_PROP_FRAME_HEIGHT, double(getImageHeight()));
|
||||||
|
|||||||
Reference in New Issue
Block a user