mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-09 03:27:45 +08:00
Adding FOURCC usb camera support (#1366)
* Adding FOURCC usb camera support * Improved warnings * more checks and warnings
This commit is contained in:
@@ -69,6 +69,7 @@ public:
|
|||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
void setResolution(int width, int height) {_width=width, _height=height;}
|
void setResolution(int width, int height) {_width=width, _height=height;}
|
||||||
|
void setFOURCC(const std::string & fourcc) { _fourcc = fourcc; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
||||||
@@ -86,6 +87,7 @@ private:
|
|||||||
int usbDevice2_;
|
int usbDevice2_;
|
||||||
int _width;
|
int _width;
|
||||||
int _height;
|
int _height;
|
||||||
|
std::string _fourcc;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
* has been loaded, thus resolution from calibration is used.
|
* has been loaded, thus resolution from calibration is used.
|
||||||
* */
|
* */
|
||||||
void setResolution(int width, int height) {_width=width, _height=height;}
|
void setResolution(int width, int height) {_width=width, _height=height;}
|
||||||
|
void setFOURCC(const std::string & fourcc) { _fourcc = fourcc; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
||||||
@@ -79,6 +80,7 @@ private:
|
|||||||
std::string _guid;
|
std::string _guid;
|
||||||
int _width;
|
int _width;
|
||||||
int _height;
|
int _height;
|
||||||
|
std::string _fourcc;
|
||||||
|
|
||||||
CameraModel _model;
|
CameraModel _model;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -199,14 +199,39 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
|||||||
{
|
{
|
||||||
if(stereoModel_.isValidForProjection())
|
if(stereoModel_.isValidForProjection())
|
||||||
{
|
{
|
||||||
|
if(_width > 0 && _height > 0 && (_width!=stereoModel_.left().imageWidth() || _height != stereoModel_.left().imageHeight()))
|
||||||
|
{
|
||||||
|
UWARN("Desired resolution of %dx%d is set but calibration has "
|
||||||
|
"been loaded with resolution %dx%d, using calibration resolution.",
|
||||||
|
_width, _height,
|
||||||
|
stereoModel_.left().imageWidth(), stereoModel_.left().imageHeight());
|
||||||
|
}
|
||||||
|
|
||||||
if(capture_.isOpened())
|
if(capture_.isOpened())
|
||||||
{
|
{
|
||||||
capture_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2));
|
bool resolutionSet = false;
|
||||||
capture_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.left().imageHeight());
|
resolutionSet = capture_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2));
|
||||||
|
resolutionSet = resolutionSet && capture_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.left().imageHeight());
|
||||||
if(capture2_.isOpened())
|
if(capture2_.isOpened())
|
||||||
{
|
{
|
||||||
capture2_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.right().imageWidth());
|
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_WIDTH, stereoModel_.right().imageWidth());
|
||||||
capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.right().imageHeight());
|
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, stereoModel_.right().imageHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the resolution was set successfully
|
||||||
|
int actualWidth = int(capture_.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||||
|
int actualHeight = int(capture_.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||||
|
if(!resolutionSet ||
|
||||||
|
actualWidth != stereoModel_.left().imageWidth()*(capture2_.isOpened()?1:2) ||
|
||||||
|
actualHeight != stereoModel_.left().imageHeight())
|
||||||
|
{
|
||||||
|
UERROR("Calibration resolution (%dx%d) cannot be set to camera driver, "
|
||||||
|
"actual resolution is %dx%d. You would have to re-calibrate with one "
|
||||||
|
"supported format by your camera. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera. For side-by-side format, you should set listed width/2.",
|
||||||
|
stereoModel_.left().imageWidth(), stereoModel_.left().imageHeight(),
|
||||||
|
actualWidth/(capture2_.isOpened()?1:2), actualHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,13 +239,92 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
|||||||
{
|
{
|
||||||
if(capture_.isOpened())
|
if(capture_.isOpened())
|
||||||
{
|
{
|
||||||
capture_.set(CV_CAP_PROP_FRAME_WIDTH, _width*(capture2_.isOpened()?1:2));
|
bool resolutionSet = false;
|
||||||
capture_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
resolutionSet = capture_.set(CV_CAP_PROP_FRAME_WIDTH, _width*(capture2_.isOpened()?1:2));
|
||||||
|
resolutionSet = resolutionSet && capture_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||||
if(capture2_.isOpened())
|
if(capture2_.isOpened())
|
||||||
{
|
{
|
||||||
capture2_.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
||||||
capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
resolutionSet = resolutionSet && capture2_.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the resolution was set successfully
|
||||||
|
int actualWidth = int(capture_.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||||
|
int actualHeight = int(capture_.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||||
|
if(!resolutionSet ||
|
||||||
|
actualWidth != _width*(capture2_.isOpened()?1:2) ||
|
||||||
|
actualHeight != _height)
|
||||||
|
{
|
||||||
|
UWARN("Desired resolution (%dx%d) cannot be set to camera driver, "
|
||||||
|
"actual resolution is %dx%d. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera. For side-by-side format, you should set listed width/2.",
|
||||||
|
_width, _height,
|
||||||
|
actualWidth/(capture2_.isOpened()?1:2), actualHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set FPS
|
||||||
|
if (this->getFrameRate() > 0)
|
||||||
|
{
|
||||||
|
bool fpsSupported = false;
|
||||||
|
fpsSupported = capture_.set(CV_CAP_PROP_FPS, this->getFrameRate());
|
||||||
|
if (capture2_.isOpened())
|
||||||
|
{
|
||||||
|
fpsSupported = fpsSupported && capture2_.set(CV_CAP_PROP_FPS, this->getFrameRate());
|
||||||
|
}
|
||||||
|
if(fpsSupported)
|
||||||
|
{
|
||||||
|
// Check if the FPS was set successfully
|
||||||
|
double actualFPS = capture_.get(cv::CAP_PROP_FPS);
|
||||||
|
|
||||||
|
if(fabs(actualFPS - this->getFrameRate()) < 0.01)
|
||||||
|
{
|
||||||
|
this->setFrameRate(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UWARN("Desired FPS (%f Hz) cannot be set to camera driver, "
|
||||||
|
"actual FPS is %f Hz. We will throttle to lowest FPS. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.",
|
||||||
|
this->getFrameRate(), actualFPS);
|
||||||
|
if(this->getFrameRate() > actualFPS)
|
||||||
|
{
|
||||||
|
this->setFrameRate(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set FOURCC
|
||||||
|
if (!_fourcc.empty())
|
||||||
|
{
|
||||||
|
if(_fourcc.size() == 4)
|
||||||
|
{
|
||||||
|
std::string fourccUpperCase = uToUpperCase(_fourcc);
|
||||||
|
int fourcc = cv::VideoWriter::fourcc(fourccUpperCase.at(0), fourccUpperCase.at(1), fourccUpperCase.at(2), fourccUpperCase.at(3));
|
||||||
|
bool fourccSupported = false;
|
||||||
|
fourccSupported = capture_.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||||
|
if (capture2_.isOpened())
|
||||||
|
{
|
||||||
|
fourccSupported = fourccSupported && capture2_.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the FOURCC was set successfully
|
||||||
|
int actualFourcc = int(capture_.get(CV_CAP_PROP_FOURCC));
|
||||||
|
|
||||||
|
if(!fourccSupported || actualFourcc != fourcc)
|
||||||
|
{
|
||||||
|
UWARN("Camera doesn't support provided FOURCC \"%s\". "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.", fourccUpperCase.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UERROR("FOURCC parameter should be 4 characters, current value is \"%s\"", _fourcc.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,13 +134,101 @@ bool CameraVideo::init(const std::string & calibrationFolder, const std::string
|
|||||||
{
|
{
|
||||||
if(_model.isValidForProjection())
|
if(_model.isValidForProjection())
|
||||||
{
|
{
|
||||||
_capture.set(CV_CAP_PROP_FRAME_WIDTH, _model.imageWidth());
|
if(_width > 0 && _height > 0 && (_width!=_model.imageWidth() || _height != _model.imageHeight()))
|
||||||
_capture.set(CV_CAP_PROP_FRAME_HEIGHT, _model.imageHeight());
|
{
|
||||||
|
UWARN("Desired resolution of %dx%d is set but calibration has "
|
||||||
|
"been loaded with resolution %dx%d, using calibration resolution.",
|
||||||
|
_width, _height,
|
||||||
|
_model.imageWidth(), _model.imageHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool resolutionSet = false;
|
||||||
|
resolutionSet = _capture.set(CV_CAP_PROP_FRAME_WIDTH, _model.imageWidth());
|
||||||
|
resolutionSet = resolutionSet && _capture.set(CV_CAP_PROP_FRAME_HEIGHT, _model.imageHeight());
|
||||||
|
|
||||||
|
// Check if the resolution was set successfully
|
||||||
|
int actualWidth = int(_capture.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||||
|
int actualHeight = int(_capture.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||||
|
if(!resolutionSet ||
|
||||||
|
actualWidth != _model.imageWidth() ||
|
||||||
|
actualHeight != _model.imageHeight())
|
||||||
|
{
|
||||||
|
UERROR("Calibration resolution (%dx%d) cannot be set to camera driver, "
|
||||||
|
"actual resolution is %dx%d. You would have to re-calibrate with one "
|
||||||
|
"supported format by your camera. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.",
|
||||||
|
_model.imageWidth(), _model.imageHeight(),
|
||||||
|
actualWidth, actualHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(_width > 0 && _height > 0)
|
else if(_width > 0 && _height > 0)
|
||||||
{
|
{
|
||||||
_capture.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
int resolutionSet = false;
|
||||||
_capture.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
resolutionSet = _capture.set(CV_CAP_PROP_FRAME_WIDTH, _width);
|
||||||
|
resolutionSet = resolutionSet && _capture.set(CV_CAP_PROP_FRAME_HEIGHT, _height);
|
||||||
|
|
||||||
|
// Check if the resolution was set successfully
|
||||||
|
int actualWidth = int(_capture.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||||
|
int actualHeight = int(_capture.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||||
|
if(!resolutionSet || actualWidth != _width || actualHeight != _height)
|
||||||
|
{
|
||||||
|
UWARN("Desired resolution (%dx%d) cannot be set to camera driver, "
|
||||||
|
"actual resolution is %dx%d. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.",
|
||||||
|
_width, _height, actualWidth, actualHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set FPS
|
||||||
|
if (this->getFrameRate() > 0 && _capture.set(CV_CAP_PROP_FPS, this->getFrameRate()))
|
||||||
|
{
|
||||||
|
// Check if the FPS was set successfully
|
||||||
|
double actualFPS = _capture.get(cv::CAP_PROP_FPS);
|
||||||
|
|
||||||
|
if(fabs(actualFPS - this->getFrameRate()) < 0.01)
|
||||||
|
{
|
||||||
|
this->setFrameRate(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UWARN("Desired FPS (%f Hz) cannot be set to camera driver, "
|
||||||
|
"actual FPS is %f Hz. We will throttle to lowest FPS. "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.",
|
||||||
|
this->getFrameRate(), actualFPS);
|
||||||
|
if(this->getFrameRate() > actualFPS)
|
||||||
|
{
|
||||||
|
this->setFrameRate(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set FOURCC
|
||||||
|
if (!_fourcc.empty())
|
||||||
|
{
|
||||||
|
if(_fourcc.size() == 4)
|
||||||
|
{
|
||||||
|
std::string fourccUpperCase = uToUpperCase(_fourcc);
|
||||||
|
int fourcc = cv::VideoWriter::fourcc(fourccUpperCase.at(0), fourccUpperCase.at(1), fourccUpperCase.at(2), fourccUpperCase.at(3));
|
||||||
|
|
||||||
|
bool fourccSupported = _capture.set(CV_CAP_PROP_FOURCC, fourcc);
|
||||||
|
|
||||||
|
// Check if the FOURCC was set successfully
|
||||||
|
int actualFourcc = int(_capture.get(CV_CAP_PROP_FOURCC));
|
||||||
|
|
||||||
|
if(!fourccSupported || actualFourcc != fourcc)
|
||||||
|
{
|
||||||
|
UWARN("Camera doesn't support provided FOURCC \"%s\". "
|
||||||
|
"Do \"v4l2-ctl --list-formats-ext\" to list all supported "
|
||||||
|
"formats by your camera.", fourccUpperCase.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UERROR("FOURCC parameter should be 4 characters, current value is \"%s\"", _fourcc.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(_rectifyImages && !_model.isValidForRectification())
|
if(_rectifyImages && !_model.isValidForRectification())
|
||||||
|
|||||||
@@ -724,6 +724,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
// usb group
|
// usb group
|
||||||
connect(_ui->spinBox_usbcam_streamWidth, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->spinBox_usbcam_streamWidth, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->spinBox_usbcam_streamHeight, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->spinBox_usbcam_streamHeight, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
connect(_ui->lineEdit_usbcam_fourcc, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
//video group
|
//video group
|
||||||
connect(_ui->source_video_toolButton_selectSource, SIGNAL(clicked()), this, SLOT(selectSourceVideoPath()));
|
connect(_ui->source_video_toolButton_selectSource, SIGNAL(clicked()), this, SLOT(selectSourceVideoPath()));
|
||||||
connect(_ui->source_video_lineEdit_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->source_video_lineEdit_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
@@ -836,6 +837,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
connect(_ui->spinBox_stereo_right_device, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->spinBox_stereo_right_device, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->spinBox_stereousbcam_streamWidth, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->spinBox_stereousbcam_streamWidth, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->spinBox_stereousbcam_streamHeight, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->spinBox_stereousbcam_streamHeight, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
connect(_ui->lineEdit_stereousbcam_fourcc, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
|
||||||
connect(_ui->comboBox_stereoZed_resolution, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_stereoZed_resolution, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
@@ -2732,6 +2734,7 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
|
|||||||
_ui->spinBox_stereo_right_device->setValue(settings.value("device2", _ui->spinBox_stereo_right_device->value()).toInt());
|
_ui->spinBox_stereo_right_device->setValue(settings.value("device2", _ui->spinBox_stereo_right_device->value()).toInt());
|
||||||
_ui->spinBox_stereousbcam_streamWidth->setValue(settings.value("width", _ui->spinBox_stereousbcam_streamWidth->value()).toInt());
|
_ui->spinBox_stereousbcam_streamWidth->setValue(settings.value("width", _ui->spinBox_stereousbcam_streamWidth->value()).toInt());
|
||||||
_ui->spinBox_stereousbcam_streamHeight->setValue(settings.value("height", _ui->spinBox_stereousbcam_streamHeight->value()).toInt());
|
_ui->spinBox_stereousbcam_streamHeight->setValue(settings.value("height", _ui->spinBox_stereousbcam_streamHeight->value()).toInt());
|
||||||
|
_ui->lineEdit_stereousbcam_fourcc->setText(settings.value("fourcc", _ui->lineEdit_stereousbcam_fourcc->text()).toString());
|
||||||
settings.endGroup(); // StereoVideo
|
settings.endGroup(); // StereoVideo
|
||||||
|
|
||||||
settings.beginGroup("StereoZed");
|
settings.beginGroup("StereoZed");
|
||||||
@@ -2809,6 +2812,7 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
|
|||||||
settings.beginGroup("UsbCam");
|
settings.beginGroup("UsbCam");
|
||||||
_ui->spinBox_usbcam_streamWidth->setValue(settings.value("width", _ui->spinBox_usbcam_streamWidth->value()).toInt());
|
_ui->spinBox_usbcam_streamWidth->setValue(settings.value("width", _ui->spinBox_usbcam_streamWidth->value()).toInt());
|
||||||
_ui->spinBox_usbcam_streamHeight->setValue(settings.value("height", _ui->spinBox_usbcam_streamHeight->value()).toInt());
|
_ui->spinBox_usbcam_streamHeight->setValue(settings.value("height", _ui->spinBox_usbcam_streamHeight->value()).toInt());
|
||||||
|
_ui->lineEdit_usbcam_fourcc->setText(settings.value("fourcc", _ui->lineEdit_usbcam_fourcc->text()).toString());
|
||||||
settings.endGroup(); // UsbCam
|
settings.endGroup(); // UsbCam
|
||||||
|
|
||||||
settings.beginGroup("Video");
|
settings.beginGroup("Video");
|
||||||
@@ -3332,6 +3336,7 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
|
|||||||
settings.setValue("device2", _ui->spinBox_stereo_right_device->value());
|
settings.setValue("device2", _ui->spinBox_stereo_right_device->value());
|
||||||
settings.setValue("width", _ui->spinBox_stereousbcam_streamWidth->value());
|
settings.setValue("width", _ui->spinBox_stereousbcam_streamWidth->value());
|
||||||
settings.setValue("height", _ui->spinBox_stereousbcam_streamHeight->value());
|
settings.setValue("height", _ui->spinBox_stereousbcam_streamHeight->value());
|
||||||
|
settings.setValue("fourcc", _ui->lineEdit_stereousbcam_fourcc->text());
|
||||||
settings.endGroup(); // StereoVideo
|
settings.endGroup(); // StereoVideo
|
||||||
|
|
||||||
settings.beginGroup("StereoZed");
|
settings.beginGroup("StereoZed");
|
||||||
@@ -3407,6 +3412,7 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
|
|||||||
settings.beginGroup("UsbCam");
|
settings.beginGroup("UsbCam");
|
||||||
settings.setValue("width", _ui->spinBox_usbcam_streamWidth->value());
|
settings.setValue("width", _ui->spinBox_usbcam_streamWidth->value());
|
||||||
settings.setValue("height", _ui->spinBox_usbcam_streamHeight->value());
|
settings.setValue("height", _ui->spinBox_usbcam_streamHeight->value());
|
||||||
|
settings.setValue("fourcc", _ui->lineEdit_usbcam_fourcc->text());
|
||||||
settings.endGroup(); // UsbCam
|
settings.endGroup(); // UsbCam
|
||||||
|
|
||||||
settings.beginGroup("Video");
|
settings.beginGroup("Video");
|
||||||
@@ -6738,6 +6744,10 @@ Camera * PreferencesDialog::createCamera(
|
|||||||
this->getSourceLocalTransform());
|
this->getSourceLocalTransform());
|
||||||
}
|
}
|
||||||
((CameraStereoVideo*)camera)->setResolution(_ui->spinBox_stereousbcam_streamWidth->value(), _ui->spinBox_stereousbcam_streamHeight->value());
|
((CameraStereoVideo*)camera)->setResolution(_ui->spinBox_stereousbcam_streamWidth->value(), _ui->spinBox_stereousbcam_streamHeight->value());
|
||||||
|
if(!_ui->lineEdit_stereousbcam_fourcc->text().isEmpty())
|
||||||
|
{
|
||||||
|
((CameraStereoVideo*)camera)->setFOURCC(_ui->lineEdit_stereousbcam_fourcc->text().toStdString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(driver == kSrcStereoVideo)
|
else if(driver == kSrcStereoVideo)
|
||||||
{
|
{
|
||||||
@@ -6866,6 +6876,10 @@ Camera * PreferencesDialog::createCamera(
|
|||||||
this->getGeneralInputRate(),
|
this->getGeneralInputRate(),
|
||||||
this->getSourceLocalTransform());
|
this->getSourceLocalTransform());
|
||||||
((CameraVideo*)camera)->setResolution(_ui->spinBox_usbcam_streamWidth->value(), _ui->spinBox_usbcam_streamHeight->value());
|
((CameraVideo*)camera)->setResolution(_ui->spinBox_usbcam_streamWidth->value(), _ui->spinBox_usbcam_streamHeight->value());
|
||||||
|
if(!_ui->lineEdit_usbcam_fourcc->text().isEmpty())
|
||||||
|
{
|
||||||
|
((CameraVideo*)camera)->setFOURCC(_ui->lineEdit_usbcam_fourcc->text().toStdString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(driver == kSrcVideo)
|
else if(driver == kSrcVideo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>-269</y>
|
||||||
<width>713</width>
|
<width>713</width>
|
||||||
<height>4653</height>
|
<height>4653</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>24</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_22">
|
<widget class="QWidget" name="page_22">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
|
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
|
||||||
@@ -3424,7 +3424,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_src">
|
<widget class="QStackedWidget" name="stackedWidget_src">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_41">
|
<widget class="QWidget" name="page_41">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_64">
|
<layout class="QVBoxLayout" name="verticalLayout_64">
|
||||||
@@ -5112,7 +5112,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_stereo">
|
<widget class="QStackedWidget" name="stackedWidget_stereo">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_49">
|
<widget class="QWidget" name="page_49">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_91"/>
|
<layout class="QVBoxLayout" name="verticalLayout_91"/>
|
||||||
@@ -5595,29 +5595,6 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<string>Usb Camera</string>
|
<string>Usb Camera</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_99" columnstretch="0,1">
|
<layout class="QGridLayout" name="gridLayout_99" columnstretch="0,1">
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="label_470">
|
|
||||||
<property name="text">
|
|
||||||
<string>Optional right device ID. It should be -1 if the stereo camera streams side-by-side images.</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="textInteractionFlags">
|
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QSpinBox" name="spinBox_stereousbcam_streamHeight">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>10000</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_620">
|
<widget class="QLabel" name="label_620">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -5631,6 +5608,29 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<spacer name="verticalSpacer_51">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinBox_stereousbcam_streamHeight">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>10000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="label_619">
|
<widget class="QLabel" name="label_619">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -5644,13 +5644,6 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QSpinBox" name="spinBox_stereo_right_device">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QSpinBox" name="spinBox_stereousbcam_streamWidth">
|
<widget class="QSpinBox" name="spinBox_stereousbcam_streamWidth">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
@@ -5661,18 +5654,45 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinBox_stereo_right_device">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_470">
|
||||||
|
<property name="text">
|
||||||
|
<string>Optional right device ID. It should be -1 if the stereo camera streams side-by-side images.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="label_755">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>FOURCC (<a href="https://fourcc.org/codecs.php"><span style=" text-decoration: underline; color:#0000ff;">https://fourcc.org/codecs.php</span></a>).</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<spacer name="verticalSpacer_51">
|
<widget class="QLineEdit" name="lineEdit_stereousbcam_fourcc">
|
||||||
<property name="orientation">
|
<property name="toolTip">
|
||||||
<enum>Qt::Vertical</enum>
|
<string>Should be 4 characters</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</widget>
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -6527,6 +6547,29 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<string>USB Camera</string>
|
<string>USB Camera</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_112" columnstretch="0,1">
|
<layout class="QGridLayout" name="gridLayout_112" columnstretch="0,1">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinBox_usbcam_streamWidth">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>10000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_552">
|
||||||
|
<property name="text">
|
||||||
|
<string>Stream width (0 for default resolution).</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QSpinBox" name="spinBox_usbcam_streamHeight">
|
<widget class="QSpinBox" name="spinBox_usbcam_streamHeight">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
@@ -6550,10 +6593,17 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_552">
|
<widget class="QLineEdit" name="lineEdit_usbcam_fourcc">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Should be 4 characters</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="label_758">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stream width (0 for default resolution).</string>
|
<string><html><head/><body><p>FOURCC (<a href="https://fourcc.org/codecs.php"><span style=" text-decoration: underline; color:#0000ff;">https://fourcc.org/codecs.php</span></a>).</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -6563,16 +6613,6 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QSpinBox" name="spinBox_usbcam_streamWidth">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>10000</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user