CameraThread.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of the Universite de Sherbrooke nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00028 #pragma once
00029 
00030 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
00031 
00032 #include <rtabmap/core/Parameters.h>
00033 #include <rtabmap/utilite/UThread.h>
00034 #include <rtabmap/utilite/UEventsSender.h>
00035 
00036 namespace clams
00037 {
00038 class DiscreteDepthDistortionModel;
00039 }
00040 
00041 namespace rtabmap
00042 {
00043 
00044 class Camera;
00045 class CameraInfo;
00046 class SensorData;
00047 class StereoDense;
00048 
00053 class RTABMAP_EXP CameraThread :
00054         public UThread,
00055         public UEventsSender
00056 {
00057 public:
00058         // ownership transferred
00059         CameraThread(Camera * camera, const ParametersMap & parameters = ParametersMap());
00060         virtual ~CameraThread();
00061 
00062         void setMirroringEnabled(bool enabled) {_mirroring = enabled;}
00063         void setStereoExposureCompensation(bool enabled) {_stereoExposureCompensation = enabled;}
00064         void setColorOnly(bool colorOnly) {_colorOnly = colorOnly;}
00065         void setImageDecimation(int decimation) {_imageDecimation = decimation;}
00066         void setStereoToDepth(bool enabled) {_stereoToDepth = enabled;}
00067         void setImageRate(float imageRate);
00068         void setDistortionModel(const std::string & path);
00069         void enableBilateralFiltering(float sigmaS, float sigmaR);
00070         void disableBilateralFiltering() {_bilateralFiltering = false;}
00071 
00072         void setScanFromDepth(
00073                         bool enabled,
00074                         int decimation=4,
00075                         float maxDepth=4.0f,
00076                         float voxelSize = 0.0f,
00077                         int normalsK = 0,
00078                         int normalsRadius = 0.0f)
00079         {
00080                 _scanFromDepth = enabled;
00081                 _scanDecimation=decimation;
00082                 _scanMaxDepth = maxDepth;
00083                 _scanVoxelSize = voxelSize;
00084                 _scanNormalsK = normalsK;
00085                 _scanNormalsRadius = normalsRadius;
00086         }
00087 
00088         void postUpdate(SensorData * data, CameraInfo * info = 0) const;
00089 
00090         //getters
00091         bool isPaused() const {return !this->isRunning();}
00092         bool isCapturing() const {return this->isRunning();}
00093 
00094         Camera * camera() {return _camera;} // return null if not set, valid until CameraThread is deleted
00095 
00096 private:
00097         virtual void mainLoopBegin();
00098         virtual void mainLoop();
00099         virtual void mainLoopKill();
00100 
00101 private:
00102         Camera * _camera;
00103         bool _mirroring;
00104         bool _stereoExposureCompensation;
00105         bool _colorOnly;
00106         int _imageDecimation;
00107         bool _stereoToDepth;
00108         bool _scanFromDepth;
00109         int _scanDecimation;
00110         float _scanMaxDepth;
00111         float _scanMinDepth;
00112         float _scanVoxelSize;
00113         int _scanNormalsK;
00114         float _scanNormalsRadius;
00115         StereoDense * _stereoDense;
00116         clams::DiscreteDepthDistortionModel * _distortionModel;
00117         bool _bilateralFiltering;
00118         float _bilateralSigmaS;
00119         float _bilateralSigmaR;
00120 };
00121 
00122 } // namespace rtabmap


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 21:59:19