object-detection.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "base-detection.h"
7 
8 
9 namespace openvino_helpers
10 {
11  /*
12  Detects object bounding boxes in an image.
13 
14  Can take any object detection model with a single input layer (type="Input") and
15  a single output layer ("DetectionOutput").
16  */
18  {
19  public:
20  struct Result
21  {
22  int label;
23  float confidence;
24  cv::Rect location;
25  };
26 
27  private:
28  // User arguments via the ctor
30 
31  // Intermediates and helpers
33  size_t _input_width; // dimensions in the model
34  size_t _input_height;
36  size_t _im_info_size;
38  size_t _max_results;
40  float _width; // of the queued image
41  float _height;
42 
43  public:
45  double detectionThreshold,
46  bool isAsync = true,
47  int maxBatch = 1, bool isBatchDynamic = false,
48  bool doRawOutputMessages = false );
49 
50  InferenceEngine::CNNNetwork read_network() override;
51  void submit_request() override;
52 
53  void enqueue( const cv::Mat &frame );
54  std::vector< Result > fetch_results();
55 
56  float get_width() const { return _width; }
57  float get_height() const { return _height; }
58  };
59 }
object_detection(const std::string &pathToModel, double detectionThreshold, bool isAsync=true, int maxBatch=1, bool isBatchDynamic=false, bool doRawOutputMessages=false)
GLsizei const GLchar *const * string
InferenceEngine::CNNNetwork read_network() override
void enqueue(const cv::Mat &frame)
std::vector< Result > fetch_results()


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:38