Skip to content

Commit

Permalink
Updated tesseract to 3.03 (prerelease)
Browse files Browse the repository at this point in the history
Notes:
* x86 only (no x64 build yet)
* based on rev 987
* Highly likely that tesseract and leptonica have different VS Runtimes
(tesseract was compiled with VS 2013, while leptonica VS 2012) this will
be fixed when I generate the x64 builds.
* Confirmed Issue #52 has been resolved.
* Could be Interop incompatibilities UNTESTED
  • Loading branch information
charlesw committed Jan 14, 2014
1 parent 8a500a3 commit fe2b5ce
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
Binary file added src/Tesseract.Tests/Data/processing/numbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/Tesseract.Tests/EngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ public void CanSetStringVariable(string variableName, string variableValue)
}
}

/// <summary>
/// As per Bug #52 setting 'classify_bln_numeric_mode' variable to '1' causes the engine to fail on processing.
/// </summary>
[Test]
public void CanSetClassifyBlnNumericModeVariable()
{
using (var engine = new TesseractEngine(@"./tessdata", "eng", EngineMode.Default)) {
engine.SetVariable("classify_bln_numeric_mode", 1);

using(var img = Pix.LoadFromFile("./Data/processing/numbers.png")) {
using(var page = engine.Process(img)) {
var text = page.GetText();

const string expectedText = "1234567890\n\n";

Assert.That(text, Is.EqualTo(expectedText));
}
}
}
}

#endregion
}
}
14 changes: 9 additions & 5 deletions src/Tesseract.Tests/Tesseract.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release40|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug40Client|AnyCPU' ">
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release40Client|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug35|AnyCPU' ">
Expand Down Expand Up @@ -88,10 +88,6 @@
<Link>x86\liblept168.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\lib\TesseractOcr\x86\libtesseract302.dll">
<Link>x86\libtesseract302.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\Binarization\neo-32bit.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -130,9 +126,17 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Data\processing" />
<Folder Include="tessdata" />
</ItemGroup>
<ItemGroup>
<None Include="..\lib\TesseractOcr\x86\libtesseract303.dll">
<Link>x86\libtesseract303.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Data\processing\numbers.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="tessdata\eng.cube.bigrams">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
2 changes: 1 addition & 1 deletion src/Tesseract/Interop/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Tesseract.Interop
/// </summary>
public static class Constants
{
public const string TesseractDllName = "libtesseract302";
public const string TesseractDllName = "libtesseract303";
public const string LeptonicaDllName = "liblept168";
}
}
4 changes: 2 additions & 2 deletions src/Tesseract/Tesseract.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<Link>x86\liblept168.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\lib\TesseractOcr\x86\libtesseract302.dll">
<Link>x86\libtesseract302.dll</Link>
<None Include="..\lib\TesseractOcr\x86\libtesseract303.dll">
<Link>x86\libtesseract303.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
Binary file removed src/lib/TesseractOcr/x86/libtesseract302.dll
Binary file not shown.
Binary file added src/lib/TesseractOcr/x86/libtesseract303.dll
Binary file not shown.

0 comments on commit fe2b5ce

Please sign in to comment.