Android OCR: AndrOCR source code error

I participate in a school project to create a business card scanner to extract text from an image and display it by name, phone number, etc. in the corresponding text fields.

In the past few weeks, I have been searching for search queries and found many great examples on the Internet. I am currently trying to embed the source code from this application, which I found on the Internet under the name "AndrOCR". However, I came across some error in codes in which I do not know how to solve in Ecilpse (juno).

I already implemented tess-two from rmtheis and was able to run some other OCR source code. However, for "AndrOCR" I cannot decide.

Error codes are shown below:

    public void onDialogSingleChoice(int dialog_id, int item){
    switch(dialog_id){

        case SEGMODE_DIALOG:
            mSegModeID = item;
            // Change the OCR page segmentation mode
            switch (mSegModeID){
            case 0:
                mSegMode = TessBaseAPI.**PSM_AUTO**;                        
                break;
            case 1:         
                mSegMode = TessBaseAPI.**PSM_SINGLE_BLOCK**;                        
                break;
            case 2:
                mSegMode = TessBaseAPI.**PSM_SINGLE_LINE**;                     
                break;
            case 3:
                mSegMode = TessBaseAPI.**PSM_SINGLE_WORD**;                     
                break;
            case 4:
                mSegMode = TessBaseAPI.**PSM_SINGLE_CHAR**;                     
                break;
            case 5:
                mSegMode = TessBaseAPI.**PSM_SINGLE_BLOCK_VERT_TEXT**;                      
                break;                  
            }                   
            // It not needed to restart the whole library here
            removeDialogFragment("segmode_dialog");
            Toast.makeText(mThis, getString(R.string.selected_text_layout) + " " + mSegModeArray[mSegModeID], Toast.LENGTH_SHORT).show();
            break;

        case LANGUAGE_DIALOG:
            mLangID = item;
            // Change the OCR language recognition
            mLang = mTessLangArray[mLangID];
            removeDialogFragment("language_dialog");
            setTessData();              
            break;
    }
}

, . "PSM_AUTO " , .

: https://github.com/TheWall89/AndrOCR

, , , , android , ~

+4
1

PageSegMode.

,

mSegMode = TessBaseAPI.PageSegMode.PSM_AUTO;

mSegMode = TessBaseAPI.PageSegMode.PSM_SINGLE_BLOCK;

.

+1

Source: https://habr.com/ru/post/1620083/


All Articles