mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 13:17:00 +08:00
Fix: Cropping image out of edge
- Fix homography draw
This commit is contained in:
@@ -225,7 +225,9 @@ def crop(image, area):
|
||||
np.ndarray:
|
||||
"""
|
||||
x1, y1, x2, y2 = area
|
||||
return image[y1:y2, x1:x2]
|
||||
h, w = image.shape[:2]
|
||||
border = np.maximum((0 - y1, y2 - h, 0 - x1, x2 - w), 0)
|
||||
return cv2.copyMakeBorder(image[y1:y2, x1:x2], *border, borderType=cv2.BORDER_CONSTANT, value=(0, 0, 0))
|
||||
|
||||
|
||||
def get_color(image, area):
|
||||
|
||||
Reference in New Issue
Block a user