selectroi专题

Opencv框选黑色字体进行替换(涉及知识点:selectROI,在控制台输入字体大小,颜色,内容替换所选择的区域)

import cv2from PIL import Image,ImageDraw,ImageFontimport numpy as npimg_path = '../img/'img_clean_path = '../img_clean/'name = 'xiao_ben'suf = '.png'img = cv2.imread(img_path+name+suf)cv2.imsho