Files
libopenshot/src/TrackedObjectBase.cpp
Jonathan Thomas ec370404d9 Add YOLO segmentation mask support to Object Detection
- Support YOLO segmentation ONNX outputs, persist sparse RLE masks in object-detection protobuf data, and render configurable mask overlays in the Object Detection effect.
- Also normalize tracked object classes at save time, smooth short mask gaps, and expose Draw Mask / Mask Color / Mask Alpha only when mask data is available.
2026-05-15 17:51:16 -05:00

41 lines
996 B
C++

/**
* @file
* @brief Source file for the TrackedObjectBase class
* @author Jonathan Thomas <jonathan@openshot.org>
* @author Brenno Caldato <brenno.caldato@outlook.com>
*
* @ref License
*/
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "TrackedObjectBase.h"
#include "Json.h"
namespace openshot
{
// Default constructor, delegating
TrackedObjectBase::TrackedObjectBase() : TrackedObjectBase("") {}
// Constructor
TrackedObjectBase::TrackedObjectBase(std::string _id)
: visible(1.0), draw_box(1), draw_text(1), draw_mask(1), id(_id) {}
Json::Value TrackedObjectBase::add_property_choice_json(
std::string name, int value, int selected_value) const
{
// Create choice
Json::Value new_choice = Json::Value(Json::objectValue);
new_choice["name"] = name;
new_choice["value"] = value;
new_choice["selected"] = (value == selected_value);
// return JsonValue
return new_choice;
}
} // namespace openshot