I want to extract the text of the following image(image-1)
After applying ostu`s binarisation and adaptive thresholding, it converts the image(image-2) into black and white.I am stuck how to extract characters from this black and white image.
here is the code for the above
import cv2
import pytesseract
img = cv2.imread("puberty.jpg", 0)
ret, thresh = cv2.threshold(img, 10, 255, cv2.THRESH_OTSU)
print("Threshold selected : ", ret)
cv2.imwrite("./pu.jpg", thresh)
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
data = pytesseract.image_to_string("pu.jpg", lang='eng', config='--psm 6')
print(data)
i am using pytessract to extract the characters but it does work.