#include "remote_ar_v2.h" #include "image_process_v5/sp_image.h" #include "image_process_v5/osg_helper.h" #include "image_process_v5/image_process.h" #include "core/yaml_utility.hpp" #include "core/imgui_utility.hpp" app_remote_ar_v2::app_remote_ar_v2(create_config _conf) : main_conf(std::move(_conf)) { auto conf = main_conf.ext_conf; if (true) { auto sub_conf = mvs_camera_ui::create_config{.ctx = main_conf.asio_ctx}; sub_conf.cameras.push_back({.dev_name = LOAD_STR("left_camera_name"), .img_name = left_img_id}); sub_conf.cameras.push_back({.dev_name = LOAD_STR("right_camera_name"), .img_name = right_img_id}); mvs_cam.emplace(sub_conf); // mvs_cam->cap_info_sig.connect([this](auto info) { // out_streamer->change_frame_rate(info.frame_rate); // }); } if (true) { auto sub_conf = stereo_output_helper::create_config(); sub_conf.left_name = left_img_id; sub_conf.right_name = right_img_id; sub_conf.out_name = output_img_id; // sub_conf.size = cv::Size(1920, 1080); sub_conf.halve_width = false; output_helper.emplace(sub_conf); } if (true) { auto sub_conf = image_viewer_v2::create_config(); sub_conf.items.emplace_back(left_img_id, "Left", true); sub_conf.items.emplace_back(right_img_id, "Right", true); sub_conf.items.emplace_back(output_img_id, "Output", true); bg_viewer.emplace(sub_conf); } } app_remote_ar_v2::~app_remote_ar_v2() = default; void app_remote_ar_v2::render_background() { bg_viewer->render(); } void app_remote_ar_v2::show_ui() { if (ImGui::Begin("Remote AR Control")) { ImGui::PushItemWidth(200); if (ImGui::CollapsingHeader("Camera")) { auto id_guard = imgui_id_guard("camera"); mvs_cam->show(); } if (ImGui::CollapsingHeader("Debug")) { if (ImGui::TreeNode("Background")) { bg_viewer->show_ui(); ImGui::TreePop(); } } ImGui::PopItemWidth(); } ImGui::End(); }