mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-11 14:00:20 +08:00
Added bilateral filtering option. CloudViewer: lighting and edge visibility options.
This commit is contained in:
@@ -58,7 +58,10 @@ CameraThread::CameraThread(Camera * camera, const ParametersMap & parameters) :
|
||||
_scanVoxelSize(0.0f),
|
||||
_scanNormalsK(0),
|
||||
_stereoDense(new StereoBM(parameters)),
|
||||
_distortionModel(0)
|
||||
_distortionModel(0),
|
||||
_bilateralFiltering(false),
|
||||
_bilateralSigmaS(10),
|
||||
_bilateralSigmaR(0.1)
|
||||
{
|
||||
UASSERT(_camera != 0);
|
||||
}
|
||||
@@ -106,6 +109,14 @@ void CameraThread::setDistortionModel(const std::string & path)
|
||||
}
|
||||
}
|
||||
|
||||
void CameraThread::enableBilateralFiltering(float sigmaS, float sigmaR)
|
||||
{
|
||||
UASSERT(sigmaS > 0.0f && sigmaR > 0.0f);
|
||||
_bilateralFiltering = true;
|
||||
_bilateralSigmaS = sigmaS;
|
||||
_bilateralSigmaR = sigmaR;
|
||||
}
|
||||
|
||||
void CameraThread::mainLoop()
|
||||
{
|
||||
UTimer totalTime;
|
||||
@@ -139,6 +150,13 @@ void CameraThread::mainLoop()
|
||||
info.timeUndistortDepth = timer.ticks();
|
||||
}
|
||||
|
||||
if(_bilateralFiltering && !data.depthRaw().empty())
|
||||
{
|
||||
UTimer timer;
|
||||
data.setDepthOrRightRaw(util2d::fastBilateralFiltering(data.depthRaw(), _bilateralSigmaS, _bilateralSigmaR));
|
||||
info.timeBilateralFiltering = timer.ticks();
|
||||
}
|
||||
|
||||
if(_imageDecimation>1 && !data.imageRaw().empty())
|
||||
{
|
||||
UDEBUG("");
|
||||
|
||||
Reference in New Issue
Block a user