mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Updated CameraVideo and CameraStereoVideo constructor interface with USB
This commit is contained in:
@@ -178,6 +178,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CameraVideo(int usbDevice = 0,
|
CameraVideo(int usbDevice = 0,
|
||||||
|
bool rectifyImages = false,
|
||||||
float imageRate = 0,
|
float imageRate = 0,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
CameraVideo(const std::string & filePath,
|
CameraVideo(const std::string & filePath,
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ public:
|
|||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
CameraStereoVideo(
|
CameraStereoVideo(
|
||||||
int device,
|
int device,
|
||||||
|
bool rectifyImages = false,
|
||||||
float imageRate = 0.0f,
|
float imageRate = 0.0f,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
virtual ~CameraStereoVideo();
|
virtual ~CameraStereoVideo();
|
||||||
|
|||||||
@@ -696,10 +696,11 @@ SensorData CameraImages::captureImage()
|
|||||||
/////////////////////////
|
/////////////////////////
|
||||||
CameraVideo::CameraVideo(
|
CameraVideo::CameraVideo(
|
||||||
int usbDevice,
|
int usbDevice,
|
||||||
|
bool rectifyImages,
|
||||||
float imageRate,
|
float imageRate,
|
||||||
const Transform & localTransform) :
|
const Transform & localTransform) :
|
||||||
Camera(imageRate, localTransform),
|
Camera(imageRate, localTransform),
|
||||||
_rectifyImages(false),
|
_rectifyImages(rectifyImages),
|
||||||
_src(kUsbDevice),
|
_src(kUsbDevice),
|
||||||
_usbDevice(usbDevice)
|
_usbDevice(usbDevice)
|
||||||
{
|
{
|
||||||
@@ -812,7 +813,7 @@ SensorData CameraVideo::captureImage()
|
|||||||
_model.setImageSize(img.size());
|
_model.setImageSize(img.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_model.isValidForRectification() && (_src != kVideoFile || _rectifyImages))
|
if(_model.isValidForRectification() && _rectifyImages)
|
||||||
{
|
{
|
||||||
img = _model.rectifyImage(img);
|
img = _model.rectifyImage(img);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1141,11 +1141,12 @@ CameraStereoVideo::CameraStereoVideo(
|
|||||||
|
|
||||||
CameraStereoVideo::CameraStereoVideo(
|
CameraStereoVideo::CameraStereoVideo(
|
||||||
int device,
|
int device,
|
||||||
|
bool rectifyImages,
|
||||||
float imageRate,
|
float imageRate,
|
||||||
const Transform & localTransform) :
|
const Transform & localTransform) :
|
||||||
Camera(imageRate, localTransform),
|
Camera(imageRate, localTransform),
|
||||||
path_(""),
|
path_(""),
|
||||||
rectifyImages_(false),
|
rectifyImages_(rectifyImages),
|
||||||
src_(CameraVideo::kUsbDevice),
|
src_(CameraVideo::kUsbDevice),
|
||||||
usbDevice_(device)
|
usbDevice_(device)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4099,6 +4099,7 @@ Camera * PreferencesDialog::createCamera(bool useRawImages)
|
|||||||
{
|
{
|
||||||
camera = new CameraStereoVideo(
|
camera = new CameraStereoVideo(
|
||||||
this->getSourceDevice().isEmpty() ? 0 : atoi(this->getSourceDevice().toStdString().c_str()),
|
this->getSourceDevice().isEmpty() ? 0 : atoi(this->getSourceDevice().toStdString().c_str()),
|
||||||
|
!useRawImages,
|
||||||
this->getGeneralInputRate(),
|
this->getGeneralInputRate(),
|
||||||
this->getSourceLocalTransform());
|
this->getSourceLocalTransform());
|
||||||
}
|
}
|
||||||
@@ -4138,6 +4139,7 @@ Camera * PreferencesDialog::createCamera(bool useRawImages)
|
|||||||
{
|
{
|
||||||
camera = new CameraVideo(
|
camera = new CameraVideo(
|
||||||
this->getSourceDevice().isEmpty()?0:atoi(this->getSourceDevice().toStdString().c_str()),
|
this->getSourceDevice().isEmpty()?0:atoi(this->getSourceDevice().toStdString().c_str()),
|
||||||
|
!useRawImages,
|
||||||
this->getGeneralInputRate(),
|
this->getGeneralInputRate(),
|
||||||
this->getSourceLocalTransform());
|
this->getSourceLocalTransform());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user