Main Page
Namespaces
Classes
Files
File List
File Members
src
kinect2_registration.cpp
Go to the documentation of this file.
1
18
#include <
kinect2_registration/kinect2_registration.h
>
19
#include <
kinect2_registration/kinect2_console.h
>
20
21
#ifdef DEPTH_REG_CPU
22
#include "
depth_registration_cpu.h
"
23
#endif
24
25
#ifdef DEPTH_REG_OPENCL
26
#include "
depth_registration_opencl.h
"
27
#endif
28
29
DepthRegistration::DepthRegistration
()
30
{
31
}
32
33
DepthRegistration::~DepthRegistration
()
34
{
35
}
36
37
bool
DepthRegistration::init
(
const
cv::Mat &
cameraMatrixRegistered
,
const
cv::Size &
sizeRegistered
,
const
cv::Mat &
cameraMatrixDepth
,
const
cv::Size &
sizeDepth
,
38
const
cv::Mat &distortionDepth,
const
cv::Mat &
rotation
,
const
cv::Mat &
translation
,
39
const
float
zNear
,
const
float
zFar
,
const
int
deviceId)
40
{
41
this->cameraMatrixRegistered =
cameraMatrixRegistered
;
42
this->cameraMatrixDepth =
cameraMatrixDepth
;
43
this->rotation =
rotation
;
44
this->translation =
translation
;
45
this->sizeRegistered =
sizeRegistered
;
46
this->sizeDepth =
sizeDepth
;
47
this->zNear =
zNear
;
48
this->zFar =
zFar
;
49
50
cv::initUndistortRectifyMap(cameraMatrixDepth, distortionDepth, cv::Mat(), cameraMatrixRegistered, sizeRegistered, CV_32FC1,
mapX
,
mapY
);
51
52
return
init
(deviceId);
53
}
54
55
DepthRegistration
*
DepthRegistration::New
(
Method
method)
56
{
57
if
(method ==
DEFAULT
)
58
{
59
#ifdef DEPTH_REG_OPENCL
60
method =
OPENCL
;
61
#elif defined DEPTH_REG_CPU
62
method =
CPU
;
63
#endif
64
}
65
66
switch
(method)
67
{
68
case
DEFAULT
:
69
OUT_ERROR
(
"No default registration method available!"
);
70
break
;
71
case
CPU
:
72
#ifdef DEPTH_REG_CPU
73
OUT_INFO
(
"Using CPU registration method!"
);
74
return
new
DepthRegistrationCPU
();
75
#else
76
OUT_ERROR
(
"CPU registration method not available!"
);
77
break
;
78
#endif
79
case
OPENCL
:
80
#ifdef DEPTH_REG_OPENCL
81
OUT_INFO
(
"Using OpenCL registration method!"
);
82
return
new
DepthRegistrationOpenCL
();
83
#else
84
OUT_ERROR
(
"OpenCL registration method not available!"
);
85
break
;
86
#endif
87
}
88
return
NULL;
89
}
90
91
92
const
std::string
getFunctionName
(
const
std::string &name)
93
{
94
size_t
end = name.rfind(
'('
);
95
if
(end == std::string::npos)
96
{
97
end = name.size();
98
}
99
size_t
begin = 1 + name.rfind(
' '
, end);
100
return
name.substr(begin, end - begin);
101
}
DepthRegistrationOpenCL
Definition:
depth_registration_opencl.h:24
getFunctionName
const std::string getFunctionName(const std::string &name)
Definition:
kinect2_registration.cpp:92
DepthRegistration::CPU
Definition:
kinect2_registration.h:32
DepthRegistration::sizeDepth
cv::Size sizeDepth
Definition:
kinect2_registration.h:38
OUT_ERROR
#define OUT_ERROR(msg)
Definition:
kinect2_console.h:45
DepthRegistration::DepthRegistration
DepthRegistration()
Definition:
kinect2_registration.cpp:29
OUT_INFO
#define OUT_INFO(msg)
Definition:
kinect2_console.h:43
DepthRegistration::mapY
cv::Mat mapY
Definition:
kinect2_registration.h:37
depth_registration_cpu.h
DepthRegistration::OPENCL
Definition:
kinect2_registration.h:33
depth_registration_opencl.h
DepthRegistration::New
static DepthRegistration * New(Method method=DEFAULT)
Definition:
kinect2_registration.cpp:55
DepthRegistration::cameraMatrixRegistered
cv::Mat cameraMatrixRegistered
Definition:
kinect2_registration.h:37
DepthRegistration::mapX
cv::Mat mapX
Definition:
kinect2_registration.h:37
DepthRegistration::sizeRegistered
cv::Size sizeRegistered
Definition:
kinect2_registration.h:38
DepthRegistration::init
virtual bool init(const int deviceId)=0
kinect2_registration.h
kinect2_console.h
DepthRegistration
Definition:
kinect2_registration.h:26
DepthRegistration::zNear
float zNear
Definition:
kinect2_registration.h:39
DepthRegistration::cameraMatrixDepth
cv::Mat cameraMatrixDepth
Definition:
kinect2_registration.h:37
DepthRegistration::~DepthRegistration
virtual ~DepthRegistration()
Definition:
kinect2_registration.cpp:33
DepthRegistration::DEFAULT
Definition:
kinect2_registration.h:31
DepthRegistration::translation
cv::Mat translation
Definition:
kinect2_registration.h:37
DepthRegistration::Method
Method
Definition:
kinect2_registration.h:29
DepthRegistrationCPU
Definition:
depth_registration_cpu.h:26
DepthRegistration::zFar
float zFar
Definition:
kinect2_registration.h:39
DepthRegistration::rotation
cv::Mat rotation
Definition:
kinect2_registration.h:37
kinect2_registration
Author(s):
autogenerated on Wed Jan 3 2018 03:48:04