34 #define int64 opencv_broken_int 35 #define uint64 opencv_broken_uint 36 #include <opencv2/dnn.hpp> 37 #include <opencv2/opencv.hpp> 38 #include <opencv2/core.hpp> 44 #include "protobuf_messages/objdetectdata.pb.h" 54 std::vector<int> _classIds,
55 std::vector<float> _confidences,
56 std::vector<cv::Rect_<float>> _boxes,
58 std::vector<int> _objectIds)
69 std::vector<cv::Rect_<float>>
boxes;
83 std::vector<std::string> classNames;
84 float confThreshold, nmsThreshold;
86 std::string classesFile;
87 std::string modelConfiguration;
88 std::string modelWeights;
89 std::string processingDevice;
90 std::string protobuf_data_path;
104 void setProcessingDevice();
107 void DetectObjects(
const cv::Mat &frame,
size_t frame_number);
109 bool iou(cv::Rect pred_box, cv::Rect sort_box);
112 void postprocess(
const cv::Size &frameDims,
const std::vector<cv::Mat>& out,
size_t frame_number);
115 std::vector<cv::String> getOutputsNames(
const cv::dnn::Net& net);
124 void detectObjectsClip(
openshot::Clip &video,
size_t start=0,
size_t end=0,
bool process_interval=
false);
130 bool SaveObjDetectedData();
132 void AddFrameDataToProto(pb_objdetect::Frame* pbFrameData,
CVDetectionData& dData);
135 void SetJson(
const std::string value);
136 void SetJsonValue(
const Json::Value root);
139 bool _LoadObjDetectdData();
std::vector< int > objectIds
std::vector< cv::Rect_< float > > boxes
This is a message class for thread safe comunication between ClipProcessingJobs and OpenCV classes...
This class represents a clip (used to arrange readers on the timeline)
This class runs trought a clip to detect objects and returns the bounding boxes and its properties...
Header file for Clip class.
Header file for JSON class.
std::vector< int > classIds
std::map< size_t, CVDetectionData > detectionsData
This namespace is the default namespace for all code in the openshot library.
std::vector< float > confidences
CVDetectionData(std::vector< int > _classIds, std::vector< float > _confidences, std::vector< cv::Rect_< float >> _boxes, size_t _frameId, std::vector< int > _objectIds)