less than 1 minute read

Tags: , , ,

前行提要

daily Programming: OCR tesseract 看圖

daily Programming: OCR 專案把玩路程

等了那麼久~~

趴山終於爬完 要來寫了拉~~ XDDD

Enlarge

# 1 直接用 fx, fy
cv2.resize(img, None, fx=1.3, fy=1.3, interpolation=cv2.INTER_CUBIC)

# 2 dim的方式
def enlarge_img(img,scale_percent = 300 ):
    width = int(img.shape[1] * scale_percent / 100)
    height = int(img.shape[0] * scale_percent / 100)
    dim = (width, height)
    resized = cv2.resize(img, dim, interpolation = cv2.INTER_AREA)
    return resized