11#ifndef OBJECT_DETECTOR_H
12#define OBJECT_DETECTOR_H
14#include "../../interfaces/BasicCamera.hpp"
15#include "../../interfaces/ZEDCamera.hpp"
16#include "./DepthDetection.hpp"
17#include "./TensorflowObjectDetection.hpp"
21#include <shared_mutex>
42 ObjectDetector(
BasicCamera* pBasicCam,
const int nNumDetectedObjectsRetrievalThreads = 5,
const bool bUsingGpuMats =
false);
43 ObjectDetector(
ZEDCamera* pZEDCam,
const int nNumDetectedObjectsRetrievalThreads = 5,
const bool bUsingGpuMats =
false);
57 bool m_bUsingZedCamera;
59 int m_nNumDetectedObjectsRetrievalThreads;
64 std::vector<depthobject::DepthObject> m_vDetectedDepthObjects;
65 std::vector<tensorflowobject::TensorflowObject> m_vDetectedTensorObjects;
77 std::queue<containers::FrameFetchContainer<cv::Mat>> m_qDetectedObjectDrawnOverlayFrames;
78 std::queue<containers::DataFetchContainer<std::vector<depthobject::DepthObject>>> m_qDetectedDepthObjectCopySchedule;
79 std::queue<containers::DataFetchContainer<std::vector<tensorflowobject::TensorflowObject>>> m_qDetectedTensorflowObjectCopySchedule;
80 std::shared_mutex m_muPoolScheduleMutex;
81 std::mutex m_muFrameCopyMutex;
82 std::mutex m_muDepthDataCopyMutex;
83 std::mutex m_muTensorflowDataCopyMutex;
90 void UpdateDetectedObjects(std::vector<depthobject::DepthObject>& vNewlyDetectedObjects);
91 void UpdateDetectedObjects(std::vector<tensorflowobject::TensorflowObject>& vNewlyDetectedObjects);
Interface class used to easily multithread a child class.
Definition AutonomyThread.hpp:38
This class serves as a middle inheritor between the Camera interface and the BasicCam class....
Definition BasicCamera.hpp:28
This interface class serves as a base for all other classes that will implement and interface with a ...
Definition Camera.hpp:34
This util class provides an easy way to keep track of iterations per second for any body of code.
Definition IPS.hpp:30
This class implements a modular and easy to use object detector for a single camera....
Definition ObjectDetector.h:37
std::future< bool > RequestDepthDetectionOverlayFrame(cv::Mat &cvFrame)
Request a copy of a frame containing the object detection overlays from the depth library.
Definition ObjectDetector.cpp:243
std::future< bool > RequestTensorflowDetectionOverlayFrame(cv::Mat &cvFrame)
Request a copy of a frame containing the object detection overlays from the tensorflow model.
Definition ObjectDetector.cpp:270
void PooledLinearCode() override
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method....
Definition ObjectDetector.cpp:158
IPS & GetIPS()
Accessor for the Frame I P S private member.
Definition ObjectDetector.cpp:384
std::future< bool > RequestDetectedTensorflowObjects(std::vector< tensorflowobject::TensorflowObject > &vTensorflowObjects)
Request the most up to date vector of detected objects from our custom tensorflow model.
Definition ObjectDetector.cpp:324
std::future< bool > RequestDetectedDepthObjects(std::vector< depthobject::DepthObject > &vDepthObjects)
Request the most up to date vector of detected objects from OpenCV's Depth algorithm.
Definition ObjectDetector.cpp:297
void ThreadedContinuousCode() override
This code will run continuously in a separate thread. New frames from the given camera are grabbed an...
Definition ObjectDetector.cpp:64
This class serves as a middle inheritor between the Camera interface and the ZEDCam class....
Definition ZEDCamera.hpp:33