
pytesseract.pytesseract.tesseract_cmd = r'/usr/bin/tesseract'original_image = cv2.imread('download (1).png')grey = cv2.cvtColor(original_image, cv2.COLOR_RGB2GRAY)height, width = original_image.shape[:2]thresh = cv2.threshold(grey, 127, 255, cv2.THRESH_BINARY)[1]cv2.imwrite("original_thresh.png", thresh)erode_kernel = numpy.array( [[0, 1], [1, 1, ]], dtype=numpy.uint8)dilate_kernel = numpy.array( [[0, 1], [1, 1], ], dtype=numpy.uint8)eroded_image = cv2.erode(thresh, erode_kernel, cv2.BORDER_REFLECT, iterations=1)dilated_image = cv2.dilate(thresh, dilate_kernel, cv2.BORDER_REFLECT, iterations=1)_, binary_upper = cv2.threshold(eroded_image, 127, 255, cv2.THRESH_BINARY)_, binary_lower = cv2.threshold(dilated_image, 127, 255, cv2.THRESH_BINARY_INV)cv2.imwrite("eroded_image.png", binary_upper)cv2.imwrite("dilated_image.png", binary_lower)binary_image = cv2.add(binary_upper, binary_lower)cv2.imwrite("binary_image.png", binary_image)
I tried to solve it by finding the outline of the captha. I do not want to proceed. Can any one suggest to me the other ways of solving the problem?