AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
RealSenseManager.hpp
Go to the documentation of this file.
1//
2// RealSenseManager.hpp
3// AI Watch A1
4//
5// Created by Denny Caruso on 23/07/22.
6//
7
8// License: Apache 2.0. See LICENSE file in root directory.
9// Copyright(c) 2022. All Rights Reserved.
10
11#ifndef RealSenseManager_hpp
12#define RealSenseManager_hpp
13
14#include <librealsense2/rs.hpp>
15#include <iostream>
16#include <opencv2/core.hpp>
17#include "../../constants.hpp"
18
19
20
26private:
30 unsigned int frameID;
35 rs2::align align;
40 struct rs2_intrinsics depth_intrin;
45 struct rs2_intrinsics color_intrin;
50 struct rs2_extrinsics depth_to_color;
55 struct rs2_extrinsics color_to_depth;
56protected:
61 void setFrameID (unsigned int frameID);
67 void set_align (rs2::align align);
72 void set_depth_intrin (struct rs2_intrinsics depth_intrin);
77 void set_color_intrin (struct rs2_intrinsics & color_intrin);
82 void set_depth_to_color (struct rs2_extrinsics depth_to_color);
87 void set_color_to_depth (struct rs2_extrinsics color_to_depth);
88
89
90
96 rs2::align get_align (void);
101 struct rs2_intrinsics get_depth_intrin (void);
106 struct rs2_extrinsics get_depth_to_color (void);
111 struct rs2_extrinsics get_color_to_depth (void);
112public:
116 RealSenseManager (void);
120 virtual ~RealSenseManager() = default;
125 unsigned int getFrameID (void);
130 struct rs2_intrinsics & get_color_intrin (void);
148 virtual void startEnvironment (rs2::pipeline & pipelineStream, struct rs2_intrinsics & color_intrin, float * scale,
149 unsigned short int resX, unsigned short int resY, bool firstBoot) = 0;
167 virtual void getVideoFramesRS (unsigned int user_nFrame, rs2::pipeline & pipelineStream,
168 rs2::depth_frame & depthFrame, rs2::frame & colorFrame,
169 rs2::frame & colorizedDepthFrame, const unsigned short int framesToSkip) = 0;
170};
171
172
173
179public:
197 void startEnvironment (rs2::pipeline & pipelineStream, struct rs2_intrinsics & color_intrin, float * scale,
198 unsigned short int resX, unsigned short int resY, bool firstBoot) override;
216 void getVideoFramesRS (unsigned int user_nFrame, rs2::pipeline & pipelineStream,
217 rs2::depth_frame & depthFrame, rs2::frame & colorFrame,
218 rs2::frame & colorizedDepthFrame, const unsigned short int framesToSkip) override;
219};
220
221#endif /* RealSenseManager_hpp */
RealSenseD435Manager class is a class that abstracts the behavior of an Intel RealSense D435 Camera,...
void startEnvironment(rs2::pipeline &pipelineStream, struct rs2_intrinsics &color_intrin, float *scale, unsigned short int resX, unsigned short int resY, bool firstBoot) override
This method is useful to invoke at the boot of the program where we want to initialize the different ...
void getVideoFramesRS(unsigned int user_nFrame, rs2::pipeline &pipelineStream, rs2::depth_frame &depthFrame, rs2::frame &colorFrame, rs2::frame &colorizedDepthFrame, const unsigned short int framesToSkip) override
Get user_nFrame video frames from the pipeline by applying a specific scaling factor....
RealSenseManager class is a class that abstracts the behavior of an Intel RealSense Camera,...
void setFrameID(unsigned int frameID)
Set the Frame ID value.
void set_depth_to_color(struct rs2_extrinsics depth_to_color)
Set the depth extrinsics object.
struct rs2_extrinsics depth_to_color
Reference to depth stream extrinsics.
void set_color_intrin(struct rs2_intrinsics &color_intrin)
Set the color intrinsics object.
void set_depth_intrin(struct rs2_intrinsics depth_intrin)
Set the depth intrinsics object.
struct rs2_intrinsics & get_color_intrin(void)
Get the color intrinsics object.
struct rs2_extrinsics get_color_to_depth(void)
Get the color extrinsics object.
virtual void getVideoFramesRS(unsigned int user_nFrame, rs2::pipeline &pipelineStream, rs2::depth_frame &depthFrame, rs2::frame &colorFrame, rs2::frame &colorizedDepthFrame, const unsigned short int framesToSkip)=0
Get user_nFrame video frames from the pipeline by applying a specific scaling factor....
struct rs2_extrinsics get_depth_to_color(void)
Get the depth extrinsics object.
struct rs2_intrinsics get_depth_intrin(void)
Get the depth intrinsics object.
void set_align(rs2::align align)
Set the align object.
virtual void startEnvironment(rs2::pipeline &pipelineStream, struct rs2_intrinsics &color_intrin, float *scale, unsigned short int resX, unsigned short int resY, bool firstBoot)=0
This method is useful to invoke at the boot of the program where we want to initialize the different ...
void set_color_to_depth(struct rs2_extrinsics color_to_depth)
Set the color extrinsics object.
rs2::align align
Auxiliary processing block that performs image alignment using depth data and camera calibration.
unsigned int getFrameID(void)
Get the current frame ID value.
struct rs2_intrinsics color_intrin
Reference to color stream intrinsics.
virtual ~RealSenseManager()=default
Destroy the RealSenseManager object.
unsigned int frameID
Current frame counter.
rs2::align get_align(void)
Get the align object.
RealSenseManager(void)
Construct a new RealSenseManager object.
struct rs2_intrinsics depth_intrin
Reference to depth stream intrinsics.
struct rs2_extrinsics color_to_depth
Reference to color stream extrinsics.