21 static const std::unordered_map<std::string, std::string>
23 {
"sensor_index",
"The selected device index."},
24 {
"config",
"AzureKinectSensor's config file."},
25 {
"timestamp",
"Timestamp in the video (usec)."},
26 {
"filename",
"Path to the mkv file."},
27 {
"enable_record",
"Enable recording to mkv file."},
28 {
"enable_align_depth_to_color",
29 "Enable aligning WFOV depth image to the color image in "
33 py::class_<AzureKinectSensorConfig> azure_kinect_sensor_config(
34 m,
"AzureKinectSensorConfig",
"AzureKinect sensor configuration.");
35 py::detail::bind_default_constructor<AzureKinectSensorConfig>(
36 azure_kinect_sensor_config);
37 azure_kinect_sensor_config.def(
38 py::init([](
const std::unordered_map<std::string, std::string>
44 py::class_<MKVMetadata> azure_kinect_mkv_metadata(
45 m,
"AzureKinectMKVMetadata",
"AzureKinect mkv metadata.");
46 py::detail::bind_default_constructor<MKVMetadata>(
47 azure_kinect_mkv_metadata);
48 azure_kinect_mkv_metadata
51 "Height of the video")
52 .def_readwrite(
"stream_length_usec",
54 "Length of the video (usec)");
57 py::class_<AzureKinectSensor> azure_kinect_sensor(m,
"AzureKinectSensor",
58 "AzureKinect sensor.");
60 azure_kinect_sensor.def(
67 "Connect to specified device.")
69 "Disconnect from the connected device.")
71 "enable_align_depth_to_color"_a,
"Capture an RGBD frame.")
73 "List available Azure Kinect devices");
82 py::class_<AzureKinectRecorder> azure_kinect_recorder(
83 m,
"AzureKinectRecorder",
"AzureKinect recorder.");
85 azure_kinect_recorder.def(
87 size_t sensor_index) {
90 "sensor_config"_a,
"sensor_index"_a);
95 "Check if the mkv file is created.")
97 "Attempt to create and open an mkv file.")
99 "Close the recorded mkv file.")
101 "enable_record"_a,
"enable_align_depth_to_color"_a,
102 "Record a frame to mkv if flag is on and return an RGBD "
117 py::class_<MKVReader> azure_kinect_mkv_reader(
118 m,
"AzureKinectMKVReader",
"AzureKinect mkv file reader.");
119 azure_kinect_mkv_reader.def(py::init([]() {
return MKVReader(); }));
120 azure_kinect_mkv_reader
122 "Check if the mkv file is opened.")
124 "Open an mkv playback.")
127 "Check if the mkv file is all read.")
129 "Get metadata of the mkv playback.")
131 "Seek to the timestamp (in us).")
133 "Get next frame from the mkv playback and returns the RGBD "
bool IsRecordCreated()
Check if the mkv file is created.
bool InitSensor() override
Initialize sensor.
bool OpenRecord(const std::string &filename) override
bool CloseRecord() override
Close the recorded mkv file.
std::shared_ptr< geometry::RGBDImage > RecordFrame(bool write, bool enable_align_depth_to_color) override
static bool ListDevices()
List available Azure Kinect devices.
bool Connect(size_t sensor_index) override
std::shared_ptr< geometry::RGBDImage > CaptureFrame(bool enable_align_depth_to_color) const override
std::shared_ptr< geometry::RGBDImage > NextFrame()
Get next frame from the mkv playback and returns the RGBD object.
MKVMetadata & GetMetadata()
Get metadata of the mkv playback.
bool IsEOF()
Check if the mkv file is all read.
bool IsOpened()
Check If the mkv file is opened.
bool Open(const std::string &filename)
bool SeekTimestamp(size_t timestamp)
Seek to the timestamp (in us).
void Close()
Close the opened mkv playback.
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
void pybind_sensor(py::module &m)
Generic file read and write utility for python interface.