MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / JsonValue

Method JsonValue

src/effects/ObjectDetection.cpp:317–339  ·  view source on GitHub ↗

Generate Json::Value for this object

Source from the content-addressed store, hash-verified

315
316// Generate Json::Value for this object
317Json::Value ObjectDetection::JsonValue() const {
318
319 // Create root json object
320 Json::Value root = EffectBase::JsonValue(); // get parent properties
321 root["type"] = info.class_name;
322 root["protobuf_data_path"] = protobuf_data_path;
323 root["selected_object_index"] = selectedObjectIndex;
324 root["confidence_threshold"] = confidence_threshold;
325 root["display_box_text"] = display_box_text.JsonValue();
326 root["display_boxes"] = display_boxes.JsonValue();
327
328 // Add tracked object's IDs to root
329 Json::Value objects;
330 for (auto const& trackedObject : trackedObjects){
331 Json::Value trackedObjectJSON = trackedObject.second->JsonValue();
332 // add object json
333 objects[trackedObject.second->Id()] = trackedObjectJSON;
334 }
335 root["objects"] = objects;
336
337 // return JsonValue
338 return root;
339}
340
341// Load JSON string into this object
342void ObjectDetection::SetJson(const std::string value) {

Callers

nothing calls this directly

Calls 1

IdMethod · 0.45

Tested by

no test coverage detected