Public Member Functions | |
| None | __init__ (self, RegionArray regions) |
| Creates a region selector. | |
| RegionArray | regions (self) |
| Get the selected regions. | |
| RegionSelector | select_by_area (self, Interval interval) |
| Select regions based on their area. | |
| RegionSelector | select_by_center_of_gravity_x (self, Union[Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval) |
| Select regions based on the center of gravity's x coordinate. | |
| RegionSelector | select_by_center_of_gravity_y (self, Union[Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval) |
| Select regions based in the center of gravity's y coordinate. | |
| RegionSelector | select_by_center_of_gravity_rect (self, Union[Rectangle, Tuple[float, float, float, float], List[float], Tuple[int, int, int, int], List[int]] rect) |
| Select regions based in the center of gravity's position within a rectangle. | |
Data Fields | |
| regions | |
Protected Member Functions | |
| RegionSelector | _select_by (self, Callable select_by_get_count_function, Callable select_by_function, ctypes.Structure c_interval) |
Protected Attributes | |
| RegionArray | _regions = regions |
Represents a selector for regions based on various criteria.
| None __init__ | ( | self, | |
| RegionArray | regions ) |
Creates a region selector.
It is possible to provide an empty numpy array (no regions), but it does not make sense, because in this case no regions can be selected.
| regions | List of Region objects to select from. |
| NotSupportedException | If regions is not a numpy array. |
|
protected |
| RegionArray regions | ( | self | ) |
Get the selected regions.
| RegionSelector select_by_area | ( | self, | |
| Interval | interval ) |
Select regions based on their area.
| interval | Interval to select by. Only positive values are allowed. |
| NotSupportedException | If interval has a wrong type or the interval is not valid for this function. |
| NotPossibleException | If interval has atleast one negative component. |
| RegionSelector select_by_center_of_gravity_rect | ( | self, | |
| Union[ Rectangle, Tuple[float, float, float, float], List[float], Tuple[int, int, int, int], List[ int]] | rect ) |
Select regions based in the center of gravity's position within a rectangle.
| rect | Rectangle to select by. |
| NotSupportedException | If interval has a wrong type or the interval is not valid for this function. |
| RegionSelector select_by_center_of_gravity_x | ( | self, | |
| Union[ Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] | interval ) |
Select regions based on the center of gravity's x coordinate.
| interval | Interval to select by. |
| NotSupportedException | If interval has a wrong type or the interval is not valid for this function. |
| RegionSelector select_by_center_of_gravity_y | ( | self, | |
| Union[ Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] | interval ) |
Select regions based in the center of gravity's y coordinate.
| interval | Interval to select by. |
| NotSupportedException | If interval has a wrong type or the interval is not valid for this function. |
|
protected |
| regions |