iOS Vuforia:TextReco 增長本身的單詞庫


      
      Vuforia的文字識別引擎提供了很好的文字識別功能。引擎依賴於UTF-8字符編碼,現支持的字符有A-Z a-z,換行符、空格、單引號、短斜槓。Note:不支持中文及數字。能識別的字體是:serif 和 sans serif 字體,支持的文字樣式有平實、加粗、斜體以及下劃線。i.e.
ios


詳細介紹,查看官網:https://developer.vuforia.com/resources/dev-guide/word-targetside


     Vuforia默認提供了一個100,000高頻英語單詞的單詞庫,但你也能夠按照須要添加本身的單詞庫,添加單詞庫並加載的步驟以下:(針對iOS平臺,在sample TR項目中添加)字體


一、下載官方提供的單詞庫格式文件,https://developer.vuforia.com/sites/default/files/AdditionalWords.zip
二、解壓將其添加進XCode中,最好和sample 原來的Vuforia-English-word.vwl 保持同一目錄下。
三、更新QCARControl.mm 中 loadWordListInBackground() 的代碼:
ui

- (void)loadWordListInBackground:(id)obj
{
    // Background thread must have its own autorelease pool
    @autoreleasepool {
            
....existing code            
            // load additional word lists
            
            // Add custom words by loading from file
            wordList->addWordsFromFile("AdditionalWords.lst", QCAR::WordList::STORAGE_APPRESOURCE);
            
        }
        else {
            error = [[ErrorReport alloc] initWithMessage:"ERROR: failed to load word list"];
        }
.... existing code
}

 


四、build & run.
  
     tips: wordList->addWordsFromFile 方法會返回一個int,表示list中單詞數,若是返回是0或者負數,則表示你的list加載失敗。

check more:https://developer.vuforia.com/forum/ios/how-add-additional-words-file-text-recognition 





編碼

相關文章
相關標籤/搜索