def set_image(self, image): ''' Takes a PIL Image and loads it into Tesseract for further operations. Note: This function will automatically convert the image to Grayscale. ''' if image is None: self.clear() else: if image.mode != "L": image = image.convert("L") Tesserwrap.set_image(self, image.tostring(), # Image data image.size[0], # Width image.size[1]) # Height
def __init__(self): Tesserwrap.__init__(self)