Added Kinect v2 calibration and registration

This commit is contained in:
matlabbe
2015-04-10 17:36:13 -04:00
parent 8ab867b802
commit 0e21be7f67
12 changed files with 561 additions and 73 deletions

View File

@@ -778,12 +778,24 @@ void CalibrationDialog::calibrate()
validRoi[1].x, validRoi[1].y, validRoi[1].width, validRoi[1].height,
imageSize.width, imageSize.height);
stereoModel_ = StereoCameraModel(
cameraName_.toStdString(),
imageSize,
models_[0].K(), models_[0].D(), R1, P1,
models_[1].K(), models_[1].D(), R2, P2,
R, T, E, F);
if(imageSize_[0].width == imageSize_[1].width)
{
//Stereo, keep new extrinsic projection matrix
stereoModel_ = StereoCameraModel(
cameraName_.toStdString(),
imageSize_[0], models_[0].K(), models_[0].D(), R1, P1,
imageSize_[1], models_[1].K(), models_[1].D(), R2, P2,
R, T, E, F);
}
else
{
//Kinect
stereoModel_ = StereoCameraModel(
cameraName_.toStdString(),
imageSize_[0], models_[0].K(), models_[0].D(), cv::Mat::eye(3,3,CV_64FC1), models_[0].P(),
imageSize_[1], models_[1].K(), models_[1].D(), cv::Mat::eye(3,3,CV_64FC1), models_[1].P(),
R, T, E, F);
}
std::stringstream strR1, strP1, strR2, strP2;
strR1 << stereoModel_.left().R();

View File

@@ -123,6 +123,7 @@ OdometryViewer::~OdometryViewer()
{
this->unregisterFromEventsManager();
this->clear();
UDEBUG("");
}
void OdometryViewer::clear()