|
|
@@ -275,11 +275,11 @@ public class VideoProcessTool {
|
|
|
}
|
|
|
|
|
|
private String doOCR(Mat img) {
|
|
|
- imwrite("text.jpg", img);
|
|
|
+ imwrite("/tmp/text.jpg", img);
|
|
|
final tesseract.TessBaseAPI baseApi = new tesseract.TessBaseAPI();
|
|
|
baseApi.Init(GetResource.class.getClassLoader().getResource("trainneddata").getPath(), "pubg");
|
|
|
baseApi.SetPageSegMode(PSM_SINGLE_LINE);
|
|
|
- baseApi.SetImage(pixRead("text.jpg"));
|
|
|
+ baseApi.SetImage(pixRead("/tmp/text.jpg"));
|
|
|
String recognizedText = baseApi.GetUTF8Text().getString();
|
|
|
return recognizedText;
|
|
|
}
|