Skip to content

Commit

Permalink
Update Tesseract (69c8292d) and Leptonica binaries; remove obsolete c…
Browse files Browse the repository at this point in the history
…ube components
  • Loading branch information
nguyenq committed Apr 17, 2018
1 parent 38a1a54 commit 9a1c725
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 376,883 deletions.
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tesseract.net</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
35 changes: 7 additions & 28 deletions src/Tesseract.Net45Tests/Tesseract.Net45Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<None Include="..\Tesseract.Tests\Data\processing\table.png" Link="Data\processing\table.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\Data\processing\w91frag.jpg" Link="Data\processing\w91frag.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\Data\Scew\scewed-phototest.png" Link="Data\Scew\scewed-phototest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -144,30 +147,6 @@
<None Include="..\Tesseract.Tests\tessdata\Configs\bazzar" Link="tessdata\Configs\bazzar">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.bigrams" Link="tessdata\eng.cube.bigrams">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.fold" Link="tessdata\eng.cube.fold">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.lm" Link="tessdata\eng.cube.lm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.nn" Link="tessdata\eng.cube.nn">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.params" Link="tessdata\eng.cube.params">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.size" Link="tessdata\eng.cube.size">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.word-freq" Link="tessdata\eng.cube.word-freq">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.tesseract_cube.nn" Link="tessdata\eng.tesseract_cube.nn">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.traineddata" Link="tessdata\eng.traineddata">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -177,19 +156,19 @@
<None Include="..\Tesseract.Tests\tessdata\eng.user-words" Link="tessdata\eng.user-words">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\pdf.ttf" Link="tessdata\pdf.ttf">
<None Include="..\Tesseract.Tests\tessdata\osd.traineddata" Link="tessdata\osd.traineddata">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\pdf.ttx" Link="tessdata\pdf.ttx">
<None Include="..\Tesseract.Tests\tessdata\pdf.ttf" Link="tessdata\pdf.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x64\liblept1744.dll" Link="x64\liblept1744.dll">
<None Include="..\Tesseract\x64\liblept1753.dll" Link="x64\liblept1753.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x64\libtesseract400.dll" Link="x64\libtesseract400.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x86\liblept1744.dll" Link="x86\liblept1744.dll">
<None Include="..\Tesseract\x86\liblept1753.dll" Link="x86\liblept1753.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x86\libtesseract400.dll" Link="x86\libtesseract400.dll">
Expand Down
35 changes: 7 additions & 28 deletions src/Tesseract.NetCore2Tests/Tesseract.NetCore2Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<None Include="..\Tesseract.Tests\Data\processing\table.png" Link="Data\processing\table.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\Data\processing\w91frag.jpg" Link="Data\processing\w91frag.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\Data\Scew\scewed-phototest.png" Link="Data\Scew\scewed-phototest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -141,30 +144,6 @@
<None Include="..\Tesseract.Tests\tessdata\Configs\bazzar" Link="tessdata\Configs\bazzar">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.bigrams" Link="tessdata\eng.cube.bigrams">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.fold" Link="tessdata\eng.cube.fold">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.lm" Link="tessdata\eng.cube.lm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.nn" Link="tessdata\eng.cube.nn">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.params" Link="tessdata\eng.cube.params">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.size" Link="tessdata\eng.cube.size">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.cube.word-freq" Link="tessdata\eng.cube.word-freq">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.tesseract_cube.nn" Link="tessdata\eng.tesseract_cube.nn">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\eng.traineddata" Link="tessdata\eng.traineddata">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -174,19 +153,19 @@
<None Include="..\Tesseract.Tests\tessdata\eng.user-words" Link="tessdata\eng.user-words">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\pdf.ttf" Link="tessdata\pdf.ttf">
<None Include="..\Tesseract.Tests\tessdata\osd.traineddata" Link="tessdata\osd.traineddata">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract.Tests\tessdata\pdf.ttx" Link="tessdata\pdf.ttx">
<None Include="..\Tesseract.Tests\tessdata\pdf.ttf" Link="tessdata\pdf.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x64\liblept1744.dll" Link="x64\liblept1744.dll">
<None Include="..\Tesseract\x64\liblept1753.dll" Link="x64\liblept1753.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x64\libtesseract400.dll" Link="x64\libtesseract400.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x86\liblept1744.dll" Link="x86\liblept1744.dll">
<None Include="..\Tesseract\x86\liblept1753.dll" Link="x86\liblept1753.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Tesseract\x86\libtesseract400.dll" Link="x86\libtesseract400.dll">
Expand Down
12 changes: 7 additions & 5 deletions src/Tesseract.Tests/AnalyseResultTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,26 @@ public void AnalyseLayout_RotatedImage(float? angle)
using (var rotatedImage = angle.HasValue ? img.Rotate(MathHelper.ToRadians(angle.Value)) : img.Clone()) {
rotatedImage.Save(TestResultRunFile(String.Format(@"AnalyseResult\AnalyseLayout_RotateImage_{0}.png", angle)));


engine.DefaultPageSegMode = PageSegMode.AutoOsd;
using (var page = engine.Process(rotatedImage)) {
using (var pageLayout = page.GetIterator()) {
pageLayout.Begin();
do {
var result = pageLayout.GetProperties();
// Note: The orientation always seem to be 'PageUp' in Tesseract 3.04 according to this test.
Assert.That(result.Orientation, Is.EqualTo(Orientation.PageUp));
Orientation orient;
float deskew;

ExpectedOrientation(angle.HasValue? angle.Value : 0, out orient, out deskew);
Assert.That(result.Orientation, Is.EqualTo(orient));

if(angle.HasValue) {
if (angle == 180f) {
// This isn't correct...
Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.LeftToRight));
Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.TopToBottom));
} else if (angle == 90f) {
Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.TopToBottom));
Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.RightToLeft));
Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.LeftToRight));
Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.TopToBottom));
} else {
Assert.Fail("Angle not supported.");
}
Expand Down
4 changes: 2 additions & 2 deletions src/Tesseract.Tests/ResultRendererTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void CanRenderResultsIntoPdfFile1()
var resultPath = TestResultRunFile(@"ResultRenderers\PDF\phototest");
using (var renderer = ResultRenderer.CreatePdfRenderer(resultPath, DataPath, false))
{
var examplePixPath = this.TestFilePath("Ocr/phototest.tif");
var examplePixPath = TestFilePath("Ocr/phototest.tif");
ProcessImageFile(renderer, examplePixPath);
}

Expand Down Expand Up @@ -103,7 +103,7 @@ public void CanRenderMultiplePageDocumentToPdfFile1()
var resultPath = TestResultRunFile(@"ResultRenderers\PDF\multi-page");
using (var renderer = ResultRenderer.CreatePdfRenderer(resultPath, DataPath, false))
{
var examplePixPath = this.TestFilePath("processing/multi-page.tif");
var examplePixPath = TestFilePath("processing/multi-page.tif");
ProcessImageFile(renderer, examplePixPath);
}

Expand Down
Loading

0 comments on commit 9a1c725

Please sign in to comment.