天天看點

python-CV常用方法封裝

背景

圖檔裁剪

def cut_img(img_path, after_path, height_start, height_stop, width_start, width_stop):
    img = cv2.imread(img_path)
    cropped_image = img[height_start:height_stop, width_start:width_stop]  # Slicing to crop the image  高:寬
    cv2.imwrite(after_path, cropped_image)      

繼續閱讀