| 94 | } |
| 95 | |
| 96 | int main(int argc, char *argv[]) { |
| 97 | std::vector<std::string> arguments(argv, argv + argc); |
| 98 | ob::Context::setLoggerSeverity(OB_LOG_SEVERITY_OFF); |
| 99 | |
| 100 | std::shared_ptr<ob::Pipeline> obPipeline; |
| 101 | try { |
| 102 | // Create OrbbecSDK pipeline (with default device). |
| 103 | obPipeline = std::make_shared<ob::Pipeline>(); |
| 104 | } catch(ob::Error &e) { |
| 105 | std::cerr << "Make sure your Orbbec device is connected!" << std::endl; |
| 106 | return EXIT_FAILURE; |
| 107 | } |
| 108 | |
| 109 | // Create Spectacular AI orbbec plugin configuration (depends on device type). |
| 110 | spectacularAI::orbbecPlugin::Configuration config(*obPipeline); |
| 111 | |
| 112 | spectacularAI::visualization::VisualizerArgs visArgs; |
| 113 | int exposureValue = -1; |
| 114 | int whiteBalanceKelvins = -1; |
| 115 | int gain = -1; |
| 116 | int brightness = -1; |
| 117 | bool preview = true; |
| 118 | bool autoSubfolders = false; |
| 119 | bool disableRecording = false; |
| 120 | |
| 121 | for (size_t i = 1; i < arguments.size(); ++i) { |
| 122 | const std::string &argument = arguments.at(i); |
| 123 | if (argument == "--output") |
| 124 | config.recordingFolder = arguments.at(++i); |
| 125 | else if (argument == "--auto_subfolders") |
| 126 | autoSubfolders = true; |
| 127 | else if (argument == "--recording_only") |
| 128 | config.recordingOnly = true; |
| 129 | else if (argument == "--color_res") |
| 130 | config.rgbResolution = tryParseResolution(arguments.at(++i)); |
| 131 | else if (argument == "--depth_res") |
| 132 | config.depthResolution = tryParseResolution(arguments.at(++i)); |
| 133 | else if (argument == "--frame_rate") |
| 134 | config.cameraFps = std::stoi(arguments.at(++i)); |
| 135 | else if (argument == "--align") |
| 136 | config.alignedDepth = true; |
| 137 | else if (argument == "--exposure") |
| 138 | exposureValue = std::stoi(arguments.at(++i)); |
| 139 | else if (argument == "--whitebalance") |
| 140 | whiteBalanceKelvins = std::stoi(arguments.at(++i)); |
| 141 | else if (argument == "--gain") |
| 142 | gain = std::stoi(arguments.at(++i)); |
| 143 | else if (argument == "--brightness") |
| 144 | brightness = std::stoi(arguments.at(++i)); |
| 145 | else if (argument == "--no_preview") |
| 146 | preview = false; |
| 147 | else if (argument == "--preview_resolution") |
| 148 | visArgs.resolution = arguments.at(++i); |
| 149 | else if (argument == "--preview_fps") |
| 150 | visArgs.targetFps = std::stoi(arguments.at(++i)); |
| 151 | else if (argument == "--fullscreen") |
| 152 | visArgs.fullScreen = true; |
| 153 | else if (argument == "--record_window") |
nothing calls this directly
no test coverage detected