OpenCV 4.5.3(日本語機械翻訳)
volume.hpp
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 // This code is also subject to the license terms in the LICENSE_KinectFusion.md file found in this
6 // module's directory
7
8 #ifndef __OPENCV_RGBD_VOLUME_H__
9 #define __OPENCV_RGBD_VOLUME_H__
10
11 #include "intrinsics.hpp"
12 #include "opencv2/core/affine.hpp"
13
14 namespace cv
15{
16 namespace kinfu
17{
18 class CV_EXPORTS_W Volume
19{
20 public:
21 Volume(float _voxelSize, Matx44f _pose, float _raycastStepFactor)
22 : voxelSize(_voxelSize),
23 voxelSizeInv(1.0f / voxelSize),
24 pose(_pose),
25 raycastStepFactor(_raycastStepFactor)
26 {
27 }
28
29 virtual ~Volume(){};
30
31 virtual void integrate(InputArray _depth, float depthFactor, const Matx44f& cameraPose,
32 const kinfu::Intr& intrinsics, const int frameId = 0) = 0;
33 virtual void integrate(InputArray _depth, InputArray _rgb, float depthFactor,
34 const Matx44f& cameraPose, const kinfu::Intr& intrinsics,
35 const Intr& rgb_intrinsics, const int frameId = 0) = 0;
36 virtual void raycast(const Matx44f& cameraPose, const kinfu::Intr& intrinsics,
37 const Size& frameSize, OutputArray points, OutputArray normals) const = 0;
38 virtual void raycast(const Matx44f& cameraPose, const kinfu::Intr& intrinsics, const Size& frameSize,
39 OutputArray points, OutputArray normals, OutputArray colors) const = 0;
40 virtual void fetchNormals(InputArray points, OutputArray _normals) const = 0;
41 virtual void fetchPointsNormals(OutputArray points, OutputArray normals) const = 0;
42 virtual void reset() = 0;
43
44 public:
45 const float voxelSize;
46 const float voxelSizeInv;
47 const Affine3f pose;
48 const float raycastStepFactor;
49};
50
51 enum class VolumeType
52{
53 TSDF = 0,
54 HASHTSDF = 1,
55 COLOREDTSDF = 2
56};
57
58 struct CV_EXPORTS_W VolumeParams
59{
63 CV_PROP_RW VolumeType type;
64
70 CV_PROP_RW Vec3i resolution;
71
76 CV_PROP_RW int unitResolution = {0};
77
79 Affine3f pose;
80
82 CV_PROP_RW float voxelSize;
83
87 CV_PROP_RW float tsdfTruncDist;
88
93 CV_PROP_RW int maxWeight;
94
98 CV_PROP_RW float depthTruncThreshold;
99
103 CV_PROP_RW float raycastStepFactor;
104
108 CV_WRAP static Ptr<VolumeParams> defaultParams(VolumeType _volumeType);
109
113 CV_WRAP static Ptr<VolumeParams> coarseParams(VolumeType _volumeType);
114};
115
116
117 Ptr<Volume> makeVolume(const VolumeParams& _volumeParams);
118CV_EXPORTS_W Ptr<Volume> makeVolume(VolumeType _volumeType, float _voxelSize, Matx44f _pose,
119 float _raycastStepFactor, float _truncDist, int _maxWeight,
120 float _truncateThreshold, Vec3i _resolution);
121
122} // namespace kinfu
123} // namespace cv
124 #endif
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
Template class for small matrices whose type and size are known at compilation time
Definition: matx.hpp:100
Template class for specifying the size of an image or rectangle.
Definition: core/types.hpp:316
Template class for short numerical vectors, a partial case of Matx
Definition: matx.hpp:342
Definition: volume.hpp:19
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74
Definition: intrinsics.hpp:16
Definition: volume.hpp:59
Affine3f pose
Initial pose of the volume in meters
Definition: volume.hpp:79