Box dataclass¶
- class mops.mixins.objects.box.Box(left: Union[int, float, None] = None, top: Union[int, float, None] = None, right: Union[int, float, None] = None, bottom: Union[int, float, None] = None, is_percents: InitVar[bool] = False)[source]¶
Represents a rectangular region defined by its edges: left, top, right, and bottom.
The class allows specifying these edges as absolute values or percentages of an image’s dimensions. It includes methods to fill missing values and calculate the coordinates of the cut box based on an image’s size.
- fill_values() None[source]¶
Replaces
Nonevalues for the cut box edges with 0.This method ensures that all edges (left, top, right, bottom) have valid numerical values, defaulting to zero where no value is provided.
- Returns: