def BinaryProcess(self,value=80): #x=cv2.resize(self.img,(450,600)) self.threshold = value bp = ip.Binarization(self.img,self.threshold) return bp
def __init__(self,ic:ImgClass): self.original=ic.img.copy() img = ic.img.copy() self.resize=cv2.resize(img,(800,600)) bp = ip.Binarization(self.resize,80) p,contours, heirs = cv2.findContours(bp,cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) pic = np.zeros(self.resize.shape).astype(np.uint8) cv2.drawContours(pic,contours,-1,(0,0,255),2) ip.CvShow(pic)