Generate Json::Value for this object
| 315 | |
| 316 | // Generate Json::Value for this object |
| 317 | Json::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 |
| 342 | void ObjectDetection::SetJson(const std::string value) { |