二值化后:
Imgproc.CvtColor(mat, mat, Imgproc.ColorBgr2gray);
Imgproc.GaussianBlur(mat, mat, new OpenCV.Core.Size(5, 5), 2);
Threshold(mat, mat, 100, 255, Imgproc.ThreshBinary);
Imgproc.Dilate(mat, mat, Imgproc.GetStructuringElement(Imgproc.MorphRect, new OpenCV.Core.Size(15, 15)));
Imgproc.Erode(mat, mat, Imgproc.GetStructuringElement(Imgproc.MorphRect, new OpenCV.Core.Size(11, 11)));
...找到轮廓,检测ROI并将其移至新Mat,调整为300DPI Tesseract似乎无法识别任何数字。
提高质量后的图像如下所示:
Tesseract有这样的设置:
tessBaseApi.SetPageSegMode(TessBaseAPI.OemTesseractCubeCombined);
tessBaseApi.SetVariable(TessBaseAPI.VarCharWhitelist, "0123456789");
任何让它识别数字的解决方案?