OpenCV 4.5.3(日本語機械翻訳)
pose_3d.hpp
[詳解]
1 //
2 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
3 //
4 // By downloading, copying, installing or using the software you agree to this license.
5 // If you do not agree to this license, do not download, install,
6 // copy or use the software.
7 //
8 //
9 // License Agreement
10 // For Open Source Computer Vision Library
11 //
12 // Copyright (C) 2014, OpenCV Foundation, all rights reserved.
13 // Third party copyrights are property of their respective owners.
14 //
15 // Redistribution and use in source and binary forms, with or without modification,
16 // are permitted provided that the following conditions are met:
17 //
18 // * Redistribution's of source code must retain the above copyright notice,
19 // this list of conditions and the following disclaimer.
20 //
21 // * Redistribution's in binary form must reproduce the above copyright notice,
22 // this list of conditions and the following disclaimer in the documentation
23 // and/or other materials provided with the distribution.
24 //
25 // * The name of the copyright holders may not be used to endorse or promote products
26 // derived from this software without specific prior written permission.
27 //
28 // This software is provided by the copyright holders and contributors "as is" and
29 // any express or implied warranties, including, but not limited to, the implied
30 // warranties of merchantability and fitness for a particular purpose are disclaimed.
31 // In no event shall the Intel Corporation or contributors be liable for any direct,
32 // indirect, incidental, special, exemplary, or consequential damages
33 // (including, but not limited to, procurement of substitute goods or services;
34 // loss of use, data, or profits; or business interruption) however caused
35 // and on any theory of liability, whether in contract, strict liability,
36 // or tort (including negligence or otherwise) arising in any way out of
37 // the use of this software, even if advised of the possibility of such damage.
38
43 #ifndef __OPENCV_SURFACE_MATCHING_POSE3D_HPP__
44 #define __OPENCV_SURFACE_MATCHING_POSE3D_HPP__
45
46 #include "opencv2/core/cvstd.hpp" // cv::Ptr
47 #include <vector>
48 #include <string>
49
50 namespace cv
51{
52 namespace ppf_match_3d
53{
54
57
58 class Pose3D;
59 typedef Ptr<Pose3D> Pose3DPtr;
60
61 class PoseCluster3D;
62 typedef Ptr<PoseCluster3D> PoseCluster3DPtr;
63
70 class CV_EXPORTS_W Pose3D
71{
72 public:
73 CV_WRAP Pose3D()
74 {
75 alpha=0;
76 modelIndex=0;
77 numVotes=0;
78 residual = 0;
79
80 pose = Matx44d::all(0);
81 }
82
83 CV_WRAP Pose3D(double Alpha, size_t ModelIndex=0, size_t NumVotes=0)
84 {
85 alpha = Alpha;
86 modelIndex = ModelIndex;
87 numVotes = NumVotes;
88 residual=0;
89
90 pose = Matx44d::all(0);
91 }
92
97 CV_WRAP void updatePose(Matx44d& NewPose);
98
102 CV_WRAP void updatePose(Matx33d& NewR, Vec3d& NewT);
103
107 CV_WRAP void updatePoseQuat(Vec4d& Q, Vec3d& NewT);
108
113 CV_WRAP void appendPose(Matx44d& IncrementalPose);
114 CV_WRAP void printPose();
115
116 Pose3DPtr clone();
117
118 int writePose(FILE* f);
119 int readPose(FILE* f);
120 int writePose(const std::string& FileName);
121 int readPose(const std::string& FileName);
122
123 virtual ~Pose3D() {}
124
125 CV_PROP double alpha, residual;
126 CV_PROP size_t modelIndex, numVotes;
127 CV_PROP Matx44d pose;
128 CV_PROP double angle;
129 CV_PROP Vec3d t;
130 CV_PROP Vec4d q;
131};
132
138 class CV_EXPORTS_W PoseCluster3D
139{
140 public:
142 {
143 numVotes=0;
144 id=0;
145 }
146
147 PoseCluster3D(Pose3DPtr newPose)
148 {
149 poseList.clear();
150 poseList.push_back(newPose);
151 numVotes=newPose->numVotes;
152 id=0;
153 }
154
155 PoseCluster3D(Pose3DPtr newPose, int newId)
156 {
157 poseList.push_back(newPose);
158 this->numVotes = newPose->numVotes;
159 this->id = newId;
160 }
161
162 virtual ~PoseCluster3D()
163 {}
164
170 void addPose(Pose3DPtr newPose);
171
172 int writePoseCluster(FILE* f);
173 int readPoseCluster(FILE* f);
174 int writePoseCluster(const std::string& FileName);
175 int readPoseCluster(const std::string& FileName);
176
177 std::vector<Pose3DPtr> poseList;
178 size_t numVotes;
179 int id;
180};
181
183
184} // namespace ppf_match_3d
185} // namespace cv
186
187 #endif
188
Template class for small matrices whose type and size are known at compilation time
Definition: matx.hpp:100
Template class for short numerical vectors, a partial case of Matx
Definition: matx.hpp:342
Class, allowing the storage of a pose. The data structure stores both the quaternions and the matrix ...
Definition: pose_3d.hpp:71
When multiple poses (see Pose3D) are grouped together (contribute to the same transformation) pose cl...
Definition: pose_3d.hpp:139
void addPose(Pose3DPtr newPose)
Adds a new pose to the cluster. The pose should be "close" to the mean poses in order to preserve the...
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74