我正在从Tess Two库获得OCR结果。我实现了一个ResultIterator与 PageIteratorLevel = Ril_Symbol。我遍历组成OCR结果文本的每个返回的字符符号。我获得每个特定符号的矩形信息,这些符号显示输入到我的OCR基本回调的图像像素中的位置。
我的目标是区分+和÷符号。苔丝2似乎无法区分÷符号。因此,我创建了以下if语句:
Rect rect = myIterator.getBoundingRect(myIteratorLevel);
//the symbol has been already previously identified
if(symbol == '+'){
//here I use a different OCR callback which I named base2
base2.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_CHAR);
base2.setImage(?);//what to set here, my original pix or the thresholded image after the original OCR call made with base1 callback
base2.setRectangle(rect);//I hope that it reads the rect where the "+" symbol lies
Log.d("results","let me see: "+base2.getUTF8Text());
base2.clear();
}
我已经设置了原始的Pix对象,该对象被馈送到base1.setImage(mypix),并且我还从调用base1.getThresholdedImage()中设置了阈值图像。
在base2.setImage()上设置两种类型的pix;在Log调用中不返回任何内容。
任何建议都会有所帮助