5
0
mirror of https://github.com/sml2h3/ddddocr.git synced 2025-05-06 12:01:26 +08:00

增加滑块小图非png透明图的识别选项

This commit is contained in:
sml2h3 2022-01-23 12:37:41 +08:00
parent c55f56b54c
commit e9f401d963

View File

@ -1643,8 +1643,8 @@ class DdddOcr(object):
end_x = x end_x = x
return image.crop([starttx, startty, end_x, end_y]), startty return image.crop([starttx, startty, end_x, end_y]), startty
def slide_match(self, target_bytes: bytes = None, simple_target=False, background_bytes: bytes = None): def slide_match(self, target_bytes: bytes = None, background_bytes: bytes = None, simple_target: bool=False):
if simple_target: if not simple_target:
target, target_y = self.get_target(target_bytes) target, target_y = self.get_target(target_bytes)
target = cv2.cvtColor(np.asarray(target), cv2.COLOR_RGBA2GRAY) target = cv2.cvtColor(np.asarray(target), cv2.COLOR_RGBA2GRAY)
else: else: