Browse Source

Fixed a bug in OCR demo.

pull/42/head
Canming Huang 8 years ago
parent
commit
1421a895c6
  1. 7
      Emgu.CV.Example/OCR/OCRForm.cs
  2. 1
      platforms/windows/Build_Binary_x86.bat

7
Emgu.CV.Example/OCR/OCRForm.cs

@ -137,10 +137,11 @@ namespace OCR
if (mode == OCRMode.FullPage)
{
ocr.SetImage(imageColor);
int recResult = ocr.Recognize();
if (ocr.Recognize() != 0)
throw new Exception("Failed to recognizer image");
Tesseract.Character[] characters = ocr.GetCharacters();
if (characters.Length == 0)
{
@ -243,6 +244,8 @@ namespace OCR
using (Mat region = new Mat(image, rect))
{
ocr.SetImage(region);
if (ocr.Recognize() != 0)
throw new Exception("Failed to recognize image");
Tesseract.Character[] characters = ocr.GetCharacters();
//convert the coordinates from the local region to global

1
platforms/windows/Build_Binary_x86.bat

@ -95,7 +95,6 @@ SET CMAKE_CONF_FLAGS= -G %CMAKE_CONF% ^
-DEMGU_ENABLE_SSE:BOOL=TRUE ^
-DBUILD_WITH_DEBUG_INFO:BOOL=FALSE ^
-DBUILD_WITH_STATIC_CRT:BOOL=FALSE ^
-DCMAKE_CONFIGURATION_TYPES:String=Release ^
-DWITH_OPENGL:BOOL=OFF ^
-DVTK_DATA_EXCLUDE_FROM_ALL:BOOL=TRUE ^
-DOPENCV_EXTRA_MODULES_PATH:String="%OPENCV_EXTRA_MODULES_DIR:\=/%"

Loading…
Cancel
Save