MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ extract_group_bounds_info()

std::unordered_map< std::string, std::any > MayaFlux::Kakshya::extract_group_bounds_info ( const RegionGroup group)

Extract bounds information from region group.

Parameters
groupRegion group to analyze.
Returns
Map containing group bounds metadata.

Definition at line 301 of file RegionUtils.cpp.

302{
303 std::unordered_map<std::string, std::any> bounds_info;
304
305 if (group.regions.empty()) {
306 return bounds_info;
307 }
308
309 const auto& first_region = group.regions[0];
310 std::vector<uint64_t> min_coords = first_region.start_coordinates;
311 std::vector<uint64_t> max_coords = first_region.end_coordinates;
312
313 for (size_t i = 1; i < group.regions.size(); ++i) {
314 const auto& region = group.regions[i];
315
316 for (size_t j = 0; j < min_coords.size() && j < region.start_coordinates.size(); ++j) {
317 min_coords[j] = std::min(min_coords[j], region.start_coordinates[j]);
318 }
319
320 for (size_t j = 0; j < max_coords.size() && j < region.end_coordinates.size(); ++j) {
321 max_coords[j] = std::max(max_coords[j], region.end_coordinates[j]);
322 }
323 }
324
325 bounds_info["group_name"] = group.name;
326 bounds_info["num_regions"] = group.regions.size();
327 bounds_info["bounding_min"] = min_coords;
328 bounds_info["bounding_max"] = max_coords;
329 bounds_info["group_attributes"] = group.attributes;
330
331 return bounds_info;
332}
std::unordered_map< std::string, std::any > attributes
Flexible key-value store for group-specific attributes.
std::vector< Region > regions
Collection of regions belonging to this group.
std::string name
Descriptive name of the group.

References MayaFlux::Kakshya::RegionGroup::attributes, MayaFlux::Kakshya::RegionGroup::name, and MayaFlux::Kakshya::RegionGroup::regions.

Referenced by MayaFlux::Yantra::infer_from_region_group().

+ Here is the caller graph for this function: