|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API Region MayaFlux::Kakshya::normalised_rect_to_region | ( | float | nx, |
| float | ny, | ||
| float | nw, | ||
| float | nh, | ||
| uint32_t | pixel_w, | ||
| uint32_t | pixel_h | ||
| ) |
Convert a normalised image rectangle to a pixel-space Region.
Input coordinates are in image space: origin top-left, x and y in [0, 1], +Y downward. Output Region uses the IMAGE_COLOR coordinate convention: start/end as { y0, x0 } / { y1, x1 } (inclusive, clamped to [0, w-1] x [0, h-1]).
This is the inverse of the normalisation performed by ConnectedComponents and Contours, and is the correct input form for get_region_data() on any pixel-bearing SignalSourceContainer.
| nx | Normalised left edge in [0, 1]. |
| ny | Normalised top edge in [0, 1]. |
| nw | Normalised width in [0, 1]. |
| nh | Normalised height in [0, 1]. |
| pixel_w | Source image width in pixels. |
| pixel_h | Source image height in pixels. |
Definition at line 377 of file CoordUtils.cpp.
Referenced by MayaFlux::Yantra::VisionExtractor< InputType, OutputType >::extract_implementation(), and normalised_points_tight_region().
Here is the caller graph for this function: