Zebra Bioptic Color Camera SDK For Linux  1.0.0-17
All Classes Functions Variables Enumerations Enumerator
camera_bounding_box_detector.h
1 #pragma once
2 // Camera object bounding box detection frame processor class header
3 #include "camera_bounding_box_factory.h"
4 
5 #include <opencv2/core.hpp>
6 #include <opencv2/highgui.hpp>
7 #include <opencv2/video/background_segm.hpp>
8 #include <opencv2/imgproc/imgproc.hpp>
9 #include <opencv2/features2d.hpp>
10 #include <opencv2/videoio.hpp>
11 
12 #include <cstring>
13 #include <iostream>
14 #include <vector>
15 #include <list>
16 
17 using namespace cv;
18 using namespace std;
19 
21 const int kParamMinArea = 100;
22 
24 const double kparamBackgroundLearnRate = -1; //0.001;
25 
30 {
31 public:
32 
35 
38  CameraBoundingBoxDetector(int history, int threshold, bool shadows);
39 
47  bool DetectBoundingBox(BYTE* input_frame_buffer,int length, int image_width, int image_height, int image_type, vector<BoundingBoxPoint> &bounding_rect) override;
48 
55  void SetBackgroundFrame(BYTE* background_frame_buffer, int length, int image_width, int image_height, int image_type) override;
56 
58  BackgroundFilterType background_type = BackgroundFilterType::kMixed;
59 
61  int param_min_area = kParamMinArea;
62 
64  double param_background_learn_rate = kparamBackgroundLearnRate;
65 
66 private:
68  void SetBackground(Mat background_frame);
69 
71  bool DetectBoundingBoxPosition(Mat input_frame, cv::Rect &bounding_rect);
72 
73  Mat saved_background_frame_;
74  Mat gray_;
75  Mat img_output_;
76  Mat diff_frame_;
77  Mat diff_frame1_;
78  Mat diff_frame2_;
79  Mat output_frame_;
80  Mat output_frame1_;
81  Mat output_frame2_;
82 
84  Ptr<BackgroundSubtractor> bg_proc_;
85 };
86 
CameraBoundingBoxDetector::DetectBoundingBox
bool DetectBoundingBox(BYTE *input_frame_buffer, int length, int image_width, int image_height, int image_type, vector< BoundingBoxPoint > &bounding_rect) override
CameraBoundingBoxDetector::SetBackgroundFrame
void SetBackgroundFrame(BYTE *background_frame_buffer, int length, int image_width, int image_height, int image_type) override
CameraBoundingBoxDetector::CameraBoundingBoxDetector
CameraBoundingBoxDetector(int history, int threshold, bool shadows)
CameraBoundingBoxDetector::CameraBoundingBoxDetector
CameraBoundingBoxDetector()
Default Camera Object bounding box detection constructor.
CameraBoundingBoxDetector
Definition: camera_bounding_box_detector.h:30
CameraBoundingBoxDetectorInterface
Camera bounding box detector interface.
Definition: camera_bounding_box_factory.h:26