|
|
@@ -93,6 +93,11 @@ app_remote_ar::app_remote_ar(const create_config &_conf) {
|
|
|
};
|
|
|
guide_decode = std::make_unique<versatile_convertor>(guide_decode_conf);
|
|
|
|
|
|
+ auto guide_control_conf = depth_guide_controller::create_config{
|
|
|
+ .img_in = guide_img, .depth_in = guide_depth, .img_out = guide_final
|
|
|
+ };
|
|
|
+ guide_controller = std::make_unique<depth_guide_controller>(guide_control_conf);
|
|
|
+
|
|
|
auto aug_conf = augment_manager::create_config{
|
|
|
.item_list = augment_manager::item_list_from_yaml(LOAD_LIST("augment_list")),
|
|
|
.sophiar_conn = sophiar_conn.get()
|
|
|
@@ -114,14 +119,24 @@ app_remote_ar::app_remote_ar(const create_config &_conf) {
|
|
|
.in_name = rgb_left, .out_name = aug_left,
|
|
|
.flip_image = true, .stream = &cam_left.stream
|
|
|
};
|
|
|
- left_aug_ren_conf.render_func_list.emplace_back([this] { cam_left.aug_helper->render(); });
|
|
|
+ left_aug_ren_conf.render_func_list.emplace_back([this] {
|
|
|
+ cam_left.aug_helper->render();
|
|
|
+ });
|
|
|
+ left_aug_ren_conf.render_func_list.emplace_back([this] {
|
|
|
+ guide_controller->render({.stream = &cam_left.stream}); // TODO: add camera specific options
|
|
|
+ });
|
|
|
cam_left.aug_render = std::make_unique<image_augment_helper>(left_aug_ren_conf);
|
|
|
|
|
|
auto right_aug_ren_conf = image_augment_helper::create_config{
|
|
|
.in_name = rgb_right, .out_name = aug_right,
|
|
|
.flip_image = true, .stream = &cam_right.stream
|
|
|
};
|
|
|
- right_aug_ren_conf.render_func_list.emplace_back([this] { cam_right.aug_helper->render(); });
|
|
|
+ right_aug_ren_conf.render_func_list.emplace_back([this] {
|
|
|
+ cam_right.aug_helper->render();
|
|
|
+ });
|
|
|
+ right_aug_ren_conf.render_func_list.emplace_back([this] {
|
|
|
+ guide_controller->render({.stream = &cam_right.stream});
|
|
|
+ });
|
|
|
cam_right.aug_render = std::make_unique<image_augment_helper>(right_aug_ren_conf);
|
|
|
|
|
|
auto output_size = cv::Size(
|
|
|
@@ -143,25 +158,25 @@ app_remote_ar::app_remote_ar(const create_config &_conf) {
|
|
|
post(*asio_ctx, [=, this] { stereo_aug->resize(size); });
|
|
|
});
|
|
|
|
|
|
-// auto bg_viewer_conf = image_viewer::create_config{
|
|
|
-// .mode = VIEW_STEREO, .flip_y = false,
|
|
|
-// .stream = default_cuda_stream,
|
|
|
-// };
|
|
|
-// auto &stereo_conf = bg_viewer_conf.extra.stereo;
|
|
|
-// stereo_conf.c_fmt = COLOR_RGB;
|
|
|
-// stereo_conf.left_name = aug_left;
|
|
|
-// stereo_conf.right_name = aug_right;
|
|
|
-// bg_viewer = std::make_unique<image_viewer>(bg_viewer_conf);
|
|
|
-
|
|
|
auto bg_viewer_conf = image_viewer::create_config{
|
|
|
- .mode = VIEW_COLOR_DEPTH, .flip_y = true,
|
|
|
+ .mode = VIEW_STEREO, .flip_y = false,
|
|
|
.stream = default_cuda_stream,
|
|
|
};
|
|
|
- auto &bg_extra_conf = bg_viewer_conf.extra.color_depth;
|
|
|
- bg_extra_conf.c_fmt = COLOR_RGB;
|
|
|
- bg_extra_conf.c_name = guide_img;
|
|
|
- bg_extra_conf.d_name = guide_depth;
|
|
|
+ auto &stereo_conf = bg_viewer_conf.extra.stereo;
|
|
|
+ stereo_conf.c_fmt = COLOR_RGB;
|
|
|
+ stereo_conf.left_name = aug_left;
|
|
|
+ stereo_conf.right_name = aug_right;
|
|
|
bg_viewer = std::make_unique<image_viewer>(bg_viewer_conf);
|
|
|
+
|
|
|
+// auto bg_viewer_conf = image_viewer::create_config{
|
|
|
+// .mode = VIEW_COLOR_DEPTH, .flip_y = true,
|
|
|
+// .stream = default_cuda_stream,
|
|
|
+// };
|
|
|
+// auto &bg_extra_conf = bg_viewer_conf.extra.color_depth;
|
|
|
+// bg_extra_conf.c_fmt = COLOR_RGB;
|
|
|
+// bg_extra_conf.c_name = guide_img;
|
|
|
+// bg_extra_conf.d_name = guide_depth;
|
|
|
+// bg_viewer = std::make_unique<image_viewer>(bg_viewer_conf);
|
|
|
}
|
|
|
|
|
|
void app_remote_ar::start_tracking() {
|
|
|
@@ -205,6 +220,8 @@ void app_remote_ar::show_ui() {
|
|
|
if (ImGui::CollapsingHeader("Depth Guide")) {
|
|
|
auto id_guard = imgui_id_guard("depth_guide");
|
|
|
guide_player->show();
|
|
|
+ ImGui::SeparatorText("Display");
|
|
|
+ guide_controller->show();
|
|
|
}
|
|
|
|
|
|
if (ImGui::CollapsingHeader("Stereo")) {
|