zerohertzLib.vision.util ¶
Functions:
| Name | Description |
|---|---|
is_pts_in_poly | 지점들의 좌표 내 존재 여부 확인 function |
_cvt_bgra ¶
cv2로 읽어온 image를 BGRA 채널로 전환
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img | NDArray[uint8] | 입력 image ( | required |
Returns:
| Type | Description |
|---|---|
NDArray[uint8] | BGRA image ( |
Source code in zerohertzLib/vision/util.py
_is_bbox ¶
Bbox 여부 검증
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape | tuple[int, ...] | Bbox의 | required |
Returns:
| Type | Description |
|---|---|
tuple[bool, bool] | 복수의 bbox 여부 및 format의 정보 |
Source code in zerohertzLib/vision/util.py
is_pts_in_poly ¶
is_pts_in_poly(poly: NDArray[DTypeLike], pts: list[int | float] | NDArray[DTypeLike]) -> bool | NDArray[bool]
지점들의 좌표 내 존재 여부 확인 function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poly | NDArray[DTypeLike] | 다각형 ( | required |
pts | list[int | float] | NDArray[DTypeLike] | point ( | required |
Returns:
| Type | Description |
|---|---|
bool | NDArray[bool] | 입력 |
Examples:
>>> poly = np.array([[10, 10], [20, 10], [30, 40], [20, 60], [10, 20]])
>>> zz.vision.is_pts_in_poly(poly, [20, 20])
True
>>> zz.vision.is_pts_in_poly(poly, [[20, 20], [100, 100]])
array([ True, False])
>>> zz.vision.is_pts_in_poly(poly, np.array([20, 20]))
True
>>> zz.vision.is_pts_in_poly(poly, np.array([[20, 20], [100, 100]]))
array([ True, False])