Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ImageProcessor(object):
- def __init__(self, image_path):
- self.original = cv2.imread(image_path, cv2.IMREAD_COLOR)
- def processImage(self):
- gray = cv2.cvtColor(self.original, cv2.COLOR_BGR2GRAY)
- thresh = cv2.adaptiveThreshold(gray, 255, 1, 1, 11, 15)
- self.showImage(thresh)
- def showImage(self, image):
- cv2.imshow("Imagen", image)
- cv2.waitKey()
- if __name__ == "__main__":
- proc = ImageProcessor("p2.png")
- proc.processImage()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement