| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef DEPTHGUIDE_ORB_CAMERA_H
- #define DEPTHGUIDE_ORB_CAMERA_H
- #include "core/cuda_helper.hpp"
- #include "core/object_manager.h"
- #include <boost/asio/io_context.hpp>
- #include <memory>
- #include <thread>
- #include <vector>
- class orb_camera {
- public:
- ~orb_camera();
- struct device_info {
- std::string sn_str;
- };
- using device_info_list_type = std::vector<device_info>;
- static device_info_list_type query_device_info();
- struct create_config {
- const char *sn_str = nullptr; // serial number
- // image_ptr, CV_32FC2
- // an image that maps each pixel to its undistorted position in the normalized plane
- obj_name_type remap_name = invalid_obj_name;
- // obj_name_type camera_intrinsic_name = invalid_obj_name; // camera_intrinsic_v2
- smart_cuda_stream *stream = nullptr;
- boost::asio::io_context *ctx = nullptr;
- };
- using this_type = orb_camera;
- using pointer = std::unique_ptr<this_type>;
- static pointer create(create_config conf);
- struct video_info {
- uint32_t index = 0;
- const char *fmt_name = nullptr;
- uint32_t fps = 0, width = 0, height = 0;
- explicit operator std::string();
- };
- enum video_type {
- V_COLOR, V_DEPTH
- };
- using vi_list_ptr = std::shared_ptr<std::vector<video_info>>;
- vi_list_ptr query_video_info(video_type type);
- vi_list_ptr query_d2c_info(uint32_t c_conf_index); // color config index
- struct start_config {
- struct color_config_type {
- bool enable = true;
- uint32_t config_index = 0;
- obj_name_type name = -1;
- } color;
- struct depth_config_type {
- bool enable = true;
- uint32_t config_index = 0;
- obj_name_type name = -1;
- } depth;
- };
- bool start(start_config conf);
- void stop();
- bool is_capturing() const;
- private:
- struct impl;
- std::unique_ptr<impl> pimpl;
- };
- #endif //DEPTHGUIDE_ORB_CAMERA_H
|