SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
initialization.hpp
1
2// initialization.h
3// Created by Greg on 2/12/2024.
4// Copyright (C) 2024 Presage Security, Inc.
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 3 of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with this program; if not, write to the Free Software Foundation,
18// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21#pragma once
22// === configuration header ===
23#include <physiology/modules/configuration.h>
24// === third-party includes (if any) ===
25#include <absl/status/status.h>
26#include <mediapipe/framework/calculator_graph.h>
27#include <mediapipe/framework/port/opencv_video_inc.h>
28#include <physiology/modules/device_type.h>
29#include <physiology/modules/device_context.h>
30// === local includes (if any) ===
31#include "settings.hpp"
32#include <smartspectra/video_source/camera/camera.hpp>
33
34namespace presage::smartspectra::container::initialization {
35
36template<
37 platform_independence::DeviceType TDeviceType,
38 settings::OperationMode TOperationMode,
39 settings::IntegrationMode TIntegrationMode,
40 bool TLog = true
41>
45absl::Status InitializeGraph(
46 mediapipe::CalculatorGraph& graph,
47 const std::string& graph_file_path,
48 const settings::Settings<TOperationMode, TIntegrationMode>& settings,
49 bool binary_graph
50);
51
55template<platform_independence::DeviceType TDeviceType, bool TLog = true>
56absl::Status InitializeComputingDevice(mediapipe::CalculatorGraph& graph, platform_independence::DeviceContext<TDeviceType>& device_context);
57
61template<platform_independence::DeviceType TDeviceType, bool TLog = true>
62absl::Status InitializeVideoSink(
63 cv::VideoWriter& stream_writer,
64 const cv::Size& input_resolution,
65 const std::string& destination,
66 const float output_fps,
67 settings::VideoSinkMode video_sink_mode
68);
69
73template<bool TLog = true>
74absl::Status InitializeGui(const settings::GeneralSettings& settings, const std::string& window_name);
75
76} // presage::smartspectra::container::initialization