Added CameraInfo class (added Camera tab in Statistics panel). Scans/userData are not saved anymore when Mem/BinDataKept=false. StereoACameraImages: Fixed error when scan path is not set. Refactoring of OdometryOpticalFlow class to provide variance when 3D->2D estimation is used.

This commit is contained in:
matlabbe
2015-11-30 18:49:28 -05:00
parent d9c9db934a
commit e58f907440
18 changed files with 267 additions and 144 deletions
+9 -4
View File
@@ -67,9 +67,9 @@ void CameraThread::setImageRate(float imageRate)
void CameraThread::mainLoop()
{
UTimer timer;
UDEBUG("");
SensorData data = _camera->takeImage();
CameraInfo info;
SensorData data = _camera->takeImage(&info);
if(!data.imageRaw().empty())
{
@@ -79,6 +79,7 @@ void CameraThread::mainLoop()
}
if(_mirroring && data.cameraModels().size() == 1)
{
UTimer timer;
cv::Mat tmpRgb;
cv::flip(data.imageRaw(), tmpRgb, 1);
data.setImageRaw(tmpRgb);
@@ -98,9 +99,11 @@ void CameraThread::mainLoop()
cv::flip(data.depthRaw(), tmpDepth, 1);
data.setDepthOrRightRaw(tmpDepth);
}
info.timeMirroring_ = timer.ticks();
}
if(_stereoToDepth && data.stereoCameraModel().isValid() && !data.rightRaw().empty())
{
UTimer timer;
cv::Mat depth = util2d::depthFromDisparity(
util2d::disparityFromStereoImages(data.imageRaw(), data.rightRaw()),
data.stereoCameraModel().left().fx(),
@@ -108,9 +111,11 @@ void CameraThread::mainLoop()
data.setCameraModel(data.stereoCameraModel().left());
data.setDepthOrRightRaw(depth);
data.setStereoCameraModel(StereoCameraModel());
info.timeDisparity_ = timer.ticks();
UINFO("Computing disparity = %f s", info.timeDisparity_);
}
this->post(new CameraEvent(data, _camera->getSerial()));
info.cameraName_ = _camera->getSerial();
this->post(new CameraEvent(data, info));
}
else if(!this->isKilled())
{