Skip to content

Commit 886bddf

Browse files
committed
switch to external structures
1 parent 129c280 commit 886bddf

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/protonect/include/libfreenect2/registration.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@
2727
#ifndef REGISTRATION_H_
2828
#define REGISTRATION_H_
2929

30-
#include <stddef.h>
30+
#include <string>
3131
#include <libfreenect2/config.h>
32-
#include <libfreenect2/protocol/response.h>
32+
#include <libfreenect2/libfreenect2.hpp>
3333

3434
namespace libfreenect2
3535
{
3636

3737
class LIBFREENECT2_API Registration
3838
{
3939
public:
40-
Registration(protocol::DepthCameraParamsResponse *depth_p, protocol::RgbCameraParamsResponse *rgb_p);
40+
Registration(Freenect2Device::IrCameraParams *depth_p, Freenect2Device::ColorCameraParams *rgb_p);
4141

4242
void apply( int dx, int dy, float dz, float& cx, float &cy);
4343

4444
private:
4545
void undistort_depth(int dx, int dy, float& mx, float& my);
4646
void depth_to_color(float mx, float my, float& rx, float& ry);
4747

48-
protocol::DepthCameraParamsResponse depth;
49-
protocol::RgbCameraParamsResponse color;
48+
Freenect2Device::IrCameraParams depth;
49+
Freenect2Device::ColorCameraParams color;
5050

5151
float undistort_map[512][424][2];
5252
float depth_to_color_map[512][424][2];

examples/protonect/src/registration.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ void Registration::depth_to_color(float mx, float my, float& rx, float& ry)
7272
(mx * mx * color.my_x2y0) + (my * my * color.my_x0y2) + (mx * my * color.my_x1y1) +
7373
(mx * color.my_x1y0) + (my * color.my_x0y1) + (color.my_x0y0);
7474

75-
rx = wx / (color.color_f * color_q);
76-
ry = wy / (color.color_f * color_q);
75+
rx = wx / (color.fx * color_q);
76+
ry = wy / (color.fx * color_q);
7777
}
7878

7979
void Registration::apply( int dx, int dy, float dz, float& cx, float &cy)
@@ -83,11 +83,11 @@ void Registration::apply( int dx, int dy, float dz, float& cx, float &cy)
8383

8484
rx += (color.shift_m / dz) - (color.shift_m / color.shift_d);
8585

86-
cx = rx * color.color_f + color.color_cx;
87-
cy = ry * color.color_f + color.color_cy;
86+
cx = rx * color.fx + color.cx;
87+
cy = ry * color.fy + color.cy;
8888
}
8989

90-
Registration::Registration(protocol::DepthCameraParamsResponse *depth_p, protocol::RgbCameraParamsResponse *rgb_p):
90+
Registration::Registration(Freenect2Device::IrCameraParams *depth_p, Freenect2Device::ColorCameraParams *rgb_p):
9191
depth(*depth_p), color(*rgb_p)
9292
{
9393
float mx, my;

0 commit comments

Comments
 (0)