Simple Template Matching and OCR Server based on GRPC
This repository contains a gRPC-based server and client for template matching and Optical Character Recognition (OCR) using OpenCV and Tesseract OCR.
./recognizer_async_server
Tesseract Base API Load Successfully
Server listening on 0.0.0.0:50051
./recognizer_client img/hey1219.png
OCR RESULT:HEY
1219
The server is implemented in C++ and exposes two gRPC services: MatchTemplate for template matching and RecognizeOpticalCharacters for OCR. The server initializes Tesseract OCR with the given language data and processes incoming requests.
The client is also implemented in C++ and communicates with the server using gRPC. The client reads the image file, sends it to the server, and receives the OCR result.
protoc --proto_path=./protos recognizer.proto --cpp_out=./ --grpc_out=./ --plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin
wget https://github.com/tesseract-ocr/tessdata/blob/main/eng.traineddata?raw=true
Put the file tessdata/ or set TESSDATA_PREFIX environment variable.
This project is licensed under the terms of the MIT license.