Hi guys, I'm trying to do tesseract recognize text from webcam. This is my code, but these errors are occurring:--
Error in pixGetDepth: pix not defined
Error in pixGetWpl: pix not defined
Error in pixGetYRes: pix not defined
Please call SetImage before attempting recognition.
~Please, sorry my bad english
import cv2
import tesseract
api = tesseract.TessBaseAPI()
api.Init(".", "eng", tesseract.OEM_DEFAULT)
while(True):
ret, frame = cv2.VideoCapture(0).read()
api.SetImage(tesseract.pixRead("gray"))
print("OCR output:\n%s" %api.GetUTF8Text());
cv2.imshow('Frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
api.End()
cv2.VideoCapture(0).release()
cv2.destroyAllWindows()
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/6f41fa9c-ebb1-43e5-a4d0-a791aad8fceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.