Added Source/Mirroring parameter for convenience

This commit is contained in:
matlabbe
2015-02-28 18:09:22 -05:00
parent 395dac5777
commit cf69f17925
9 changed files with 100 additions and 43 deletions

View File

@@ -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;
}

View File

@@ -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());
}