14 #ifndef OPENSHOT_OBJECT_DETECTION_EFFECT_H 15 #define OPENSHOT_OBJECT_DETECTION_EFFECT_H 30 std::vector<int> _classIds,
31 std::vector<float> _confidences,
32 std::vector<cv::Rect_<float>> _boxes,
34 std::vector<int> _objectIds)
45 std::vector<cv::Rect_<float>>
boxes;
60 std::string protobuf_data_path;
61 std::map<size_t, DetectionData> detectionsData;
62 std::vector<std::string> classNames;
64 std::vector<cv::Scalar> classesColor;
69 float confidence_threshold = 0.5;
71 std::vector<std::string> display_classes;
72 std::string class_filter;
75 void init_effect_details();
77 void drawPred(
int classId,
float conf, cv::Rect2d box, cv::Mat& frame,
int objectNumber, std::vector<int> color,
float alpha,
78 int thickness,
bool is_background,
bool draw_text);
80 void DrawRectangleRGBA(cv::Mat &frame_image, cv::RotatedRect box, std::vector<int> color,
float alpha,
int thickness,
bool is_background);
101 std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number)
override;
103 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number)
override {
return GetFrame(std::make_shared<Frame>(), frame_number); }
106 bool LoadObjDetectdData(std::string inputFilePath);
109 std::string GetVisibleObjects(int64_t frame_number)
const override;
112 std::string Json()
const override;
113 void SetJson(
const std::string value)
override;
114 Json::Value JsonValue()
const override;
115 void SetJsonValue(
const Json::Value root)
override;
119 std::string PropertiesJSON(int64_t requested_frame)
const override;
std::vector< cv::Rect_< float > > boxes
This abstract class is the base class, used by all effects in libopenshot.
int selectedObjectIndex
Index of the Tracked Object that was selected to modify it's properties.
std::vector< int > classIds
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
This effect displays all the detected objects on a clip.
DetectionData(std::vector< int > _classIds, std::vector< float > _confidences, std::vector< cv::Rect_< float >> _boxes, size_t _frameId, std::vector< int > _objectIds)
Header file for the Keyframe class.
std::vector< int > objectIds
Header file for OpenCVUtilities (set some common macros)
Header file for JSON class.
This namespace is the default namespace for all code in the openshot library.
Header file for EffectBase class.
std::vector< float > confidences
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...