CameraK4A: rectifying color image (this improves a lot visual odometry accuracy)

This commit is contained in:
matlabbe
2020-12-13 15:27:17 -05:00
parent d700d09339
commit d8ebbc2645
2 changed files with 23 additions and 7 deletions

View File

@@ -286,8 +286,6 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
cv::Size(calibration_.depth_camera_calibration.resolution_width, calibration_.depth_camera_calibration.resolution_height),
K,D,R,P,
this->getLocalTransform());
UASSERT(model_.isValidForRectification());
model_.initRectificationMap();
}
else
{
@@ -317,6 +315,8 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
K,D,R,P,
this->getLocalTransform());
}
UASSERT(model_.isValidForRectification());
model_.initRectificationMap();
if (ULogger::level() <= ULogger::kInfo)
{
@@ -490,6 +490,7 @@ SensorData CameraK4A::captureImage(CameraInfo * info)
cv::cvtColor(bgra, bgrCV, CV_BGRA2BGR);
}
bgrCV = model_.rectifyImage(bgrCV);
// Release the image
k4a_image_release(rgb_image_);