2013-03-28 21 views
0

我使用Tess4j來進行光學識別,它對於我給我的程序的幾乎所有圖片都非常有效。我在81個盒子中切斷了數獨掃描網格。但是,當我拿一個包含數字的方塊時,Tess4j無法檢測到數字。我不知道爲什麼,數字在白色背景上是黑色的。任何人都可以幫助我嗎?用於檢測數獨網格數字的Java OCR

感謝您的回覆!

回答

0

您可以嘗試各種分頁模式(PSM),Tesseract必須獲得最佳結果。

pagesegmode values are: 
0 = Orientation and script detection (OSD) only. 
1 = Automatic page segmentation with OSD. 
2 = Automatic page segmentation, but no OSD, or OCR 
3 = Fully automatic page segmentation, but no OSD. (Default) 
4 = Assume a single column of text of variable sizes. 
5 = Assume a single uniform block of vertically aligned text. 
6 = Assume a single uniform block of text. 
7 = Treat the image as a single text line. 
8 = Treat the image as a single word. 
9 = Treat the image as a single word in a circle. 
10 = Treat the image as a single character.