MayaFlux 0.3.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 295 of file RegionUtils.cpp.

296{
297 std::unordered_map<std::string, std::any> bounds_info;
298
299 if (group.regions.empty()) {
300 return bounds_info;
301 }
302
303 const auto& first_region = group.regions[0];
304 std::vector<uint64_t> min_coords = first_region.start_coordinates;
305 std::vector<uint64_t> max_coords = first_region.end_coordinates;
306
307 for (size_t i = 1; i < group.regions.size(); ++i) {
308 const auto& region = group.regions[i];
309
310 for (size_t j = 0; j < min_coords.size() && j < region.start_coordinates.size(); ++j) {
311 min_coords[j] = std::min(min_coords[j], region.start_coordinates[j]);
312 }
313
314 for (size_t j = 0; j < max_coords.size() && j < region.end_coordinates.size(); ++j) {
315 max_coords[j] = std::max(max_coords[j], region.end_coordinates[j]);
316 }
317 }
318
319 bounds_info["group_name"] = group.name;
320 bounds_info["num_regions"] = group.regions.size();
321 bounds_info["bounding_min"] = min_coords;
322 bounds_info["bounding_max"] = max_coords;
323 bounds_info["group_attributes"] = group.attributes;
324
325 return bounds_info;
326}
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, extract_group_bounds_info(), MayaFlux::Kakshya::RegionGroup::name, and MayaFlux::Kakshya::RegionGroup::regions.

Referenced by extract_group_bounds_info(), and MayaFlux::Yantra::infer_from_region_group().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: