mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Calibration: added support for stereo IR cameras
This commit is contained in:
@@ -348,7 +348,8 @@ SensorData::SensorData(
|
|||||||
else if(!left.empty())
|
else if(!left.empty())
|
||||||
{
|
{
|
||||||
UASSERT(left.type() == CV_8UC1 || // Mono
|
UASSERT(left.type() == CV_8UC1 || // Mono
|
||||||
left.type() == CV_8UC3); // RGB
|
left.type() == CV_8UC3 || // RGB
|
||||||
|
left.type() == CV_16UC1); // IR
|
||||||
_imageRaw = left;
|
_imageRaw = left;
|
||||||
}
|
}
|
||||||
if(right.rows == 1)
|
if(right.rows == 1)
|
||||||
@@ -358,7 +359,8 @@ SensorData::SensorData(
|
|||||||
}
|
}
|
||||||
else if(!right.empty())
|
else if(!right.empty())
|
||||||
{
|
{
|
||||||
UASSERT(right.type() == CV_8UC1); // Mono
|
UASSERT(right.type() == CV_8UC1 || // Mono
|
||||||
|
right.type() == CV_16UC1); // IR
|
||||||
_depthOrRightRaw = right;
|
_depthOrRightRaw = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public:
|
|||||||
const rtabmap::CameraModel & getLeftCameraModel() const {return models_[0];}
|
const rtabmap::CameraModel & getLeftCameraModel() const {return models_[0];}
|
||||||
const rtabmap::CameraModel & getRightCameraModel() const {return models_[1];}
|
const rtabmap::CameraModel & getRightCameraModel() const {return models_[1];}
|
||||||
const rtabmap::StereoCameraModel & getStereoCameraModel() const {return stereoModel_;}
|
const rtabmap::StereoCameraModel & getStereoCameraModel() const {return stereoModel_;}
|
||||||
|
bool isProcessing() const {return processingData_;}
|
||||||
|
|
||||||
void saveSettings(QSettings & settings, const QString & group = "") const;
|
void saveSettings(QSettings & settings, const QString & group = "") const;
|
||||||
void loadSettings(QSettings & settings, const QString & group = "");
|
void loadSettings(QSettings & settings, const QString & group = "");
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ void CalibrationDialog::handleEvent(UEvent * event)
|
|||||||
|
|
||||||
void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat & imageRight, const QString & cameraName)
|
void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat & imageRight, const QString & cameraName)
|
||||||
{
|
{
|
||||||
|
UDEBUG("Processing images");
|
||||||
processingData_ = true;
|
processingData_ = true;
|
||||||
if(cameraName_.isEmpty())
|
if(cameraName_.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -306,6 +307,18 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
|
|||||||
{
|
{
|
||||||
if(images[id].type() == CV_16UC1)
|
if(images[id].type() == CV_16UC1)
|
||||||
{
|
{
|
||||||
|
double min, max;
|
||||||
|
cv::minMaxLoc(images[id], &min, &max);
|
||||||
|
UDEBUG("Camera IR %d: min=%f max=%f", id, min, max);
|
||||||
|
if(minIrs_[id] == 0)
|
||||||
|
{
|
||||||
|
minIrs_[id] = min;
|
||||||
|
}
|
||||||
|
if(maxIrs_[id] == 0x7fff)
|
||||||
|
{
|
||||||
|
maxIrs_[id] = max;
|
||||||
|
}
|
||||||
|
|
||||||
depthDetected = true;
|
depthDetected = true;
|
||||||
//assume IR image: convert to gray scaled
|
//assume IR image: convert to gray scaled
|
||||||
const float factor = 255.0f / float((maxIrs_[id] - minIrs_[id]));
|
const float factor = 255.0f / float((maxIrs_[id] - minIrs_[id]));
|
||||||
|
|||||||
Reference in New Issue
Block a user