|
OpenShot Library | libopenshot
0.7.0
|
Go to the documentation of this file.
14 #ifndef OPENSHOT_OBJECT_DETECTION_EFFECT_H
15 #define OPENSHOT_OBJECT_DETECTION_EFFECT_H
28 class TrackedObjectBBox;
35 std::vector<int> _classIds,
36 std::vector<float> _confidences,
37 std::vector<cv::Rect_<float>> _boxes,
39 std::vector<int> _objectIds,
40 std::vector<openshot::ObjectMaskData> _masks = {})
52 std::vector<cv::Rect_<float>>
boxes;
54 std::vector<openshot::ObjectMaskData>
masks;
68 std::string protobuf_data_path;
69 std::map<size_t, DetectionData> detectionsData;
70 std::vector<std::string> classNames;
71 std::vector<cv::Scalar> classesColor;
80 float confidence_threshold = 0.25;
83 std::vector<std::string> display_classes;
84 std::string class_filter;
87 std::shared_ptr<TrackedObjectBBox> allObjectsProperties;
90 void init_effect_details();
108 std::shared_ptr<Frame>
GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number)
override;
110 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number)
override {
return GetFrame(std::make_shared<Frame>(), frame_number); }
119 std::shared_ptr<QImage>
TrackedObjectMask(std::shared_ptr<QImage> target_image, int64_t frame_number)
const override;
122 std::string
Json()
const override;
123 void SetJson(
const std::string value)
override;
129 std::string
PropertiesJSON(int64_t requested_frame)
const override;
void SetJson(const std::string value) override
Load JSON string into this object.
std::shared_ptr< Frame > GetFrame(std::shared_ptr< Frame > frame, int64_t frame_number) override
This method is required for all derived classes of EffectBase, and returns a modified openshot::Frame...
This abstract class is the base class, used by all effects in libopenshot.
Json::Value JsonValue() const override
Generate Json::Value for this object.
This namespace is the default namespace for all code in the openshot library.
std::vector< int > objectIds
Header file for EffectBase class.
Header file for the Keyframe class.
ObjectDetection()
Default constructor.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
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...
std::vector< openshot::ObjectMaskData > masks
std::string Json() const override
Generate JSON string of this object.
std::vector< int > classIds
std::vector< float > confidences
This effect displays all the detected objects on a clip.
bool LoadObjDetectdData(std::string inputFilePath)
Load protobuf data file.
std::string PropertiesJSON(int64_t requested_frame) const override
std::vector< cv::Rect_< float > > boxes
std::shared_ptr< QImage > TrackedObjectMask(std::shared_ptr< QImage > target_image, int64_t frame_number) const override
Generate a black/white mask from visible detected bounding boxes.
std::string GetVisibleObjects(int64_t frame_number) const override
Get the indexes and IDs of all visible objects in the given frame.
Header file for the TrackedObjectBBox class.
Header file for JSON class.
DetectionData(std::vector< int > _classIds, std::vector< float > _confidences, std::vector< cv::Rect_< float >> _boxes, size_t _frameId, std::vector< int > _objectIds, std::vector< openshot::ObjectMaskData > _masks={})
int selectedObjectIndex
Index of the Tracked Object that was selected to modify it's properties.
Header file for OpenCVUtilities (set some common macros)
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.