mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added Source/Mirroring parameter for convenience
This commit is contained in:
@@ -50,6 +50,7 @@ Camera::Camera(float imageRate,
|
||||
_imageRate(imageRate),
|
||||
_imageWidth(imageWidth),
|
||||
_imageHeight(imageHeight),
|
||||
_mirroring(false),
|
||||
_frameRateTimer(new UTimer())
|
||||
{
|
||||
}
|
||||
@@ -177,6 +178,10 @@ cv::Mat Camera::takeImage()
|
||||
cv::Mat temp = img.clone();
|
||||
cv::undistort(temp, img, _k, _d);
|
||||
}
|
||||
if(!img.empty() && _mirroring)
|
||||
{
|
||||
cv::flip(img,img,1);
|
||||
}
|
||||
UDEBUG("Time capturing image = %fs", timer.ticks());
|
||||
return img;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,15 @@ void CameraRGBD::takeImage(cv::Mat & rgb, cv::Mat & depth, float & fx, float & f
|
||||
{
|
||||
cy = _cy; // override if set
|
||||
}
|
||||
if(!rgb.empty() && !depth.empty() && _mirroring)
|
||||
{
|
||||
cv::flip(rgb,rgb,1);
|
||||
cv::flip(depth,depth,1);
|
||||
if(cx != 0.0f)
|
||||
{
|
||||
cx = float(rgb.cols) - cx;
|
||||
}
|
||||
}
|
||||
UDEBUG("Time capturing image = %fs", timer.ticks());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user