A implementation of the OpenCV /dnn/text_detection
sample written in Go, and using the GoCV package. The implementation
attempts to stay as faithful as the original C++ and Python sample provided in the OpenCV repository which uses the pre-trained
EAST Text Detection Tensorflow Model.
In order to run the example, the following must be installed:
- GoCV v0.27
- OpenCV 4.5.1
Instructions to install these two dependencies can be found here
The EAST Text Detection Model and the Text Recognition Model must be downloaded via the links in the Resources section below.
Specify a file in the input
if you wish to perform text detection against a static image.
go run main.go -input images/bottle.jpg -model frozen_east_text_detection.pb -ocr CRNN_VGG_BiLSTM_CTC.onnx
Omit the input
flag if you wish to perform text detection from a camera source. Other optional flags are available
to adjust the default confidence levels.
When ran against the bottle.jpg
sample image, the EAST Text Detection Model correctly identifies the text on this bottle.
It is also able to correctly identify the words ALTO
in this image below.