SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
image_transfer.hpp
1
2// image_transfer.h
3// Created by Greg on 2/16/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// === standard library includes (if any) ===
23// === third-party includes (if any) ===
24#include <absl/status/status.h>
25#include <mediapipe/framework/formats/image_frame.h>
26#include <mediapipe/framework/calculator_framework.h>
27#include <mediapipe/framework/port/opencv_core_inc.h>
28#include <physiology/modules/device_type.h>
29#include <physiology/modules/device_context.h>
30// === local includes (if any) ===
31
32namespace presage::smartspectra::container::image_transfer {
33
37absl::Status FeedFrameToGraph(
38 std::unique_ptr<mediapipe::ImageFrame> input_frame,
39 mediapipe::CalculatorGraph& graph,
40 const int64_t& frame_timestamp,
41 const char* video_stream
42);
43
47template<presage::platform_independence::DeviceType TDeviceType>
48absl::Status FeedFrameToGraph(
49 std::unique_ptr<mediapipe::ImageFrame> input_frame,
50 mediapipe::CalculatorGraph& graph,
51 presage::platform_independence::DeviceContext<TDeviceType>& device_context,
52 const int64_t& frame_timestamp,
53 const char* video_stream
54);
55
57absl::Status GetFrameFromPacket(
58 cv::Mat& output_frame_rgb,
59 const mediapipe::Packet& output_video_packet
60);
61
65template<presage::platform_independence::DeviceType TDeviceType>
66absl::Status GetFrameFromPacket(
67 cv::Mat& output_frame_rgb,
68 presage::platform_independence::DeviceContext<TDeviceType>& device_context,
69 const mediapipe::Packet& output_video_packet
70);
71
72
73} // namespace presage::smartspectra::container::image_transfer