1 // This file is part of OpenCV project. 2 // It is subject to the license terms in the LICENSE file found in the top-level directory 3 // of this distribution and at http://opencv.org/license.html 4 5 #ifndef __OPENCV_HASH_TSDF_H__ 6 #define __OPENCV_HASH_TSDF_H__ 7 8 #include <opencv2/rgbd/volume.hpp> 9 #include <unordered_map> 10 #include <unordered_set> 11 12 #include "tsdf_functions.hpp" 13 14 namespace cv 15 { 16 namespace kinfu 17 { 18 class HashTSDFVolume : public Volume 19 { 20 public: 21 // dimension in voxels, size in meters 22 //! Use fixed volume cuboid 23 HashTSDFVolume(float _voxelSize, cv::Matx44f _pose, float _raycastStepFactor, float _truncDist, 24 int _maxWeight, float _truncateThreshold, int _volumeUnitRes, 25 bool zFirstMemOrder = true); 26 27 virtual ~HashTSDFVolume() = default; 28 29 virtual int getVisibleBlocks(int currFrameId, int frameThreshold) const = 0; 30 virtual size_t getTotalVolumeUnits() const = 0; 31 32 public: 33 int maxWeight; 34 float truncDist; 35 float truncateThreshold; 36 int volumeUnitResolution; 37 int volumeUnitDegree; 38 float volumeUnitSize; 39 bool zFirstMemOrder; 40 Vec4i volStrides; 41 }; 42 43 //template<typename T> 44 Ptr<HashTSDFVolume> makeHashTSDFVolume(const VolumeParams& _volumeParams); 45 //template<typename T> 46 Ptr<HashTSDFVolume> makeHashTSDFVolume(float _voxelSize, Matx44f _pose, float _raycastStepFactor, float _truncDist, 47 int _maxWeight, float truncateThreshold, int volumeUnitResolution = 16); 48 49 } // namespace kinfu 50 } // namespace cv 51 #endif 52