MayaFlux 0.1.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 279 of file RegionUtils.cpp.

280{
281 std::unordered_map<std::string, std::any> bounds_info;
282
283 if (group.regions.empty()) {
284 return bounds_info;
285 }
286
287 const auto& first_region = group.regions[0];
288 std::vector<uint64_t> min_coords = first_region.start_coordinates;
289 std::vector<uint64_t> max_coords = first_region.end_coordinates;
290
291 for (size_t i = 1; i < group.regions.size(); ++i) {
292 const auto& region = group.regions[i];
293
294 for (size_t j = 0; j < min_coords.size() && j < region.start_coordinates.size(); ++j) {
295 min_coords[j] = std::min(min_coords[j], region.start_coordinates[j]);
296 }
297
298 for (size_t j = 0; j < max_coords.size() && j < region.end_coordinates.size(); ++j) {
299 max_coords[j] = std::max(max_coords[j], region.end_coordinates[j]);
300 }
301 }
302
303 bounds_info["group_name"] = group.name;
304 bounds_info["num_regions"] = group.regions.size();
305 bounds_info["bounding_min"] = min_coords;
306 bounds_info["bounding_max"] = max_coords;
307 bounds_info["group_attributes"] = group.attributes;
308
309 return bounds_info;
310}
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: