this is simple code to detect text and recognize from an image.
1.opencv
2 pytesseract
you need to install pytesseract.exe file
provide the path where .exe file is stored like
C:\Program Files\Tesseract-OCR\tesseract.exe
install pytesseract in windows using pip
pip install pytesseract
downlaod and install pytesseract.exe file from the given link
https://tesseract-ocr.github.io/tessdoc/4.0-with-LSTM