update menti

This commit is contained in:
2023-08-06 16:12:13 +02:00
parent 9cc4018747
commit b1fc655c0b
3 changed files with 20 additions and 9 deletions

View File

@@ -61,18 +61,20 @@ def check_for_bl_line(line_item, black_list):
return False
def scale_screenshot(screenshot):
scale_percent = 200 # percent of original size
def scale_screenshot(screenshot, percent = 200, thresh_mode = True):
scale_percent = percent # percent of original size
width = int(screenshot.shape[1] * scale_percent / 100)
height = int(screenshot.shape[0] * scale_percent / 100)
dim = (width, height)
resized_img = cv.resize(screenshot, dim, interpolation=4)
gray = cv.cvtColor(resized_img, cv.COLOR_BGR2GRAY)
thresh = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV + cv.THRESH_OTSU)[1]
if thresh_mode:
gray = cv.cvtColor(resized_img, cv.COLOR_BGR2GRAY)
thresh = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV + cv.THRESH_OTSU)[1]
return thresh
# cv.imshow("Tresh", thresh)
# cv.waitKey(1000)
return thresh
return resized_img
def save_line_item_npy_jpg(short_pic_list):