plugin  0.1.0
metadata.h
1 /*
2 // Copyright (C) 2018-2024 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
17 #pragma once
18 #include <utils/ocv_common.hpp>
19 
20 struct MetaData {
21  virtual ~MetaData() {}
22 
23  template <class T>
24  T& asRef() {
25  return dynamic_cast<T&>(*this);
26  }
27 
28  template <class T>
29  const T& asRef() const {
30  return dynamic_cast<const T&>(*this);
31  }
32 };
33 
34 struct ImageMetaData : public MetaData {
35  cv::Mat img;
36  std::chrono::steady_clock::time_point timeStamp;
37 
38  ImageMetaData() {}
39 
40  ImageMetaData(cv::Mat img, std::chrono::steady_clock::time_point timeStamp) : img(img), timeStamp(timeStamp) {}
41 };
42 
44  unsigned int groundTruthId;
45 
46  ClassificationImageMetaData(cv::Mat img,
47  std::chrono::steady_clock::time_point timeStamp,
48  unsigned int groundTruthId)
49  : ImageMetaData(img, timeStamp),
50  groundTruthId(groundTruthId) {}
51 };
a header file with common samples functionality using OpenCV
Definition: metadata.h:43
Definition: metadata.h:34
Definition: metadata.h:20