17 #ifndef ASTRA_DEPTH_HPP
18 #define ASTRA_DEPTH_HPP
20 #include <astra_core/astra_core.hpp>
21 #include <astra/capi/astra_ctypes.h>
22 #include <astra/capi/streams/depth_capi.h>
23 #include <astra/streams/Image.hpp>
24 #include <astra/Vector.hpp>
46 : depthStream_(depthStream)
54 this->depthStream_ = rhs.depthStream_;
62 this->depthStream_ = rhs.depthStream_;
74 float worldX, worldY, worldZ;
75 astra_convert_depth_to_world(depthStream_,
79 &worldX, &worldY, &worldZ);
81 return Vector3f(worldX, worldY, worldZ);
92 float depthX, depthY, depthZ;
93 astra_convert_world_to_depth(depthStream_,
97 &depthX, &depthY, &depthZ);
99 return Vector3f(depthX, depthY, depthZ);
113 float& worldX,
float& worldY,
float& worldZ)
const
115 astra_convert_depth_to_world(depthStream_, depthX, depthY, depthZ,
116 &worldX, &worldY, &worldZ);
130 float& depthX,
float& depthY,
float& depthZ)
const
132 astra_convert_world_to_depth(depthStream_,
133 worldX, worldY, worldZ,
134 &depthX, &depthY, &depthZ);
155 static const astra_stream_type_t
id = ASTRA_STREAM_DEPTH;
165 astra_depthstream_get_depth_to_world_data(depthStream_, &data);
177 bool enabled =
false;
178 astra_depthstream_get_registration(depthStream_, &enabled);
190 astra_depthstream_set_registration(depthStream_, enable);
223 astra_depthstream_get_serialnumber(depthStream_, serialnumber, length);
233 char serialNumber[ASTRA_SERIAL_NUMBER_MAX];
234 astra_depthstream_get_serialnumber(depthStream_, serialNumber,
sizeof(serialNumber) /
sizeof(
char));
235 return std::string(serialNumber);
246 astra_depthstream_get_chip_id(depthStream_, &
chip_id);
257 astra_depthstream_start_record(depthStream_, filename.c_str());
265 astra_depthstream_stop_record(depthStream_);
290 :
ImageFrame(frame, ASTRA_PIXEL_FORMAT_DEPTH_MM)
CoordinateMapper
Definition: Depth.hpp:40
Vector3f convert_world_to_depth(Vector3f worldPosition) const
convert depth coor to world coor
Definition: Depth.hpp:90
CoordinateMapper operator=(const CoordinateMapper &rhs)
copy Constructs
Definition: Depth.hpp:60
void convert_depth_to_world(float depthX, float depthY, float depthZ, float &worldX, float &worldY, float &worldZ) const
convert depth coor to world coor
Definition: Depth.hpp:112
void convert_world_to_depth(float worldX, float worldY, float worldZ, float &depthX, float &depthY, float &depthZ) const
convert world coor to depth coor
Definition: Depth.hpp:129
CoordinateMapper(const CoordinateMapper &rhs)
copy Constructs
Definition: Depth.hpp:52
astra::Vector3f convert_depth_to_world(astra::Vector3f depthPosition) const
convert depth coor to world coor
Definition: Depth.hpp:72
CoordinateMapper(astra_depthstream_t depthStream)
Constructs
Definition: Depth.hpp:45
A Depth Frame
Definition: Depth.hpp:287
A Depth Stream
Definition: Depth.hpp:147
int get_d2c_resolution()
get depth to color resolution if device supports.
Definition: Depth.hpp:208
void enable_registration(bool enable)
enable registration
Definition: Depth.hpp:188
std::string serial_number() const
get serial number
Definition: Depth.hpp:231
void start_record(std::string filename)
start record oni file.
Definition: Depth.hpp:255
const CoordinateMapper & coordinateMapper() const
get Coordinate Mapper
Definition: Depth.hpp:273
std::uint32_t chip_id() const
get chip id
Definition: Depth.hpp:243
bool registration_enabled() const
return is registration enabled
Definition: Depth.hpp:175
void stop_record()
stop record oni file.
Definition: Depth.hpp:263
void serial_number(char *serialnumber, uint32_t length) const
get serial number
Definition: Depth.hpp:221
void set_d2c_resolution(int mode)
set depth to color resolution if device supports.
Definition: Depth.hpp:198
astra_conversion_cache_t depth_to_world_data() const
get world conversion
Definition: Depth.hpp:162
Basic Image Frame
Definition: Image.hpp:397
ImageFrame(astra_imageframe_t frame, astra_pixel_format_t expected_format)
Default constructs
Definition: Image.hpp:405
basic Image Stream
Definition: Image.hpp:271
ImageStreamMode mode() const
get current image mode
Definition: Image.hpp:368
ASTRA_API_EX astra_status_t astra_depthstream_set_d2c_resolution(astra_depthstream_t depthStream, int mode)
ASTRA_API_EX astra_status_t astra_depthstream_get_d2c_resolution(astra_depthstream_t depthStream, int *mode)
Definition: stream_types.h:37
Definition: astra_plugin.h:24
Represents a float 3d vector
Definition: Vector3f.hpp:30
Definition: depth_types.h:23