diff --git a/ChangeLog.md b/ChangeLog.md
index b194b287..985a6416 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,5 @@
### Version 5.0
-* Upgraded to Tesseract 5.0 [Issue 579](https://github.com/charlesw/tesseract/issues/579)
+* Upgraded to Tesseract 5.2 [Issue 579](https://github.com/charlesw/tesseract/issues/579)
* Fixed Fix dynamic linking on macos [Issue #588](https://github.com/charlesw/tesseract/issues/588)
* Fixed null reference exception when executing assembly is not available [Issue 591](https://github.com/charlesw/tesseract/issues/591)
@@ -8,6 +8,7 @@
* Setting regions of interest doesn't work [Issue 489](https://github.com/charlesw/tesseract/issues/489)
* PageSegMode.SingleBlockVertText does not work [Issue 490](https://github.com/charlesw/tesseract/issues/490)
* Unz files don't work [Issue 594](https://github.com/charlesw/tesseract/issues/594)
+* Removed support for dotnet 4.0 and 4.5
### Version 4.1.1
diff --git a/docs/Compling_tesseract_and_leptonica.md b/docs/Compling_tesseract_and_leptonica.md
index 511dc6ff..bcd3b7f3 100644
--- a/docs/Compling_tesseract_and_leptonica.md
+++ b/docs/Compling_tesseract_and_leptonica.md
@@ -10,7 +10,7 @@ The following also differ from [[Compiling-Tesseract-and-Leptonica]] in that the
The main benefit of this is that it's possible to compile tesseract against the leptonica dll rather than statically
linking leptonica into tesseract which increases file size (since the leptonica dll is still required).
-1. Install Visual Studio 2019
+1. Install Visual Studio 2022
2. Install CMake (ensure it's on your path)
3. Install [vcpkg](https://github.com/Microsoft/vcpkg/)
* Note: I also set an environment variable VCPKG_HOME to this directory and added it to path for convenience
@@ -21,13 +21,13 @@ linking leptonica into tesseract which increases file size (since the leptonica
vcpkg install giflib:x86-windows-static libjpeg-turbo:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static tiff:x86-windows-static zlib:x86-windows-static
vcpkg install giflib:x64-windows-static libjpeg-turbo:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static tiff:x64-windows-static zlib:x64-windows-static
git clone https://github.com/DanBloomberg/leptonica.git & cd leptonica
- git checkout -b 1.80.0 1.80.0
+ git checkout -b 1.82.0 1.82.0
mkdir vs16-x86 & cd vs16-x86
- cmake .. -G "Visual Studio 16 2019" -A Win32 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x86
+ cmake .. -G "Visual Studio 17 2022" -A Win32 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x86
cmake --build . --config Release --target install
cd ..
mkdir vs16-x64 & cd vs16-x64
- cmake .. -G "Visual Studio 16 2019" -A x64 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x64
+ cmake .. -G "Visual Studio 17 2022" -A x64 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x64
cmake --build . --config Release --target install
```
4. Build Tesseract:
@@ -36,13 +36,13 @@ linking leptonica into tesseract which increases file size (since the leptonica
```
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesserct
- git checkout -b 4.1.1 4.1.1
- mkdir vs16-x86 & cd vs16-x86
- cmake .. -G "Visual Studio 16 2019" -A Win32 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x86
+ git checkout -b 5.2.0 5.2.0
+ mkdir vs17-x86 & cd vs17-x86
+ cmake .. -G "Visual Studio 17 2022" -A Win32 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x86
cmake --build . --config Release --target install
cd ..
- mkdir vs16-x64 & cd vs16-x64
- cmake .. -G "Visual Studio 16 2019" -A x64 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x64
+ mkdir vs17-x64 & cd vs17-x64
+ cmake .. -G "Visual Studio 17 2022" -A x64 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x64
cmake --build . --config Release --target install
```
diff --git a/docs/Compling_tesseract_and_leptonica.md.bak b/docs/Compling_tesseract_and_leptonica.md.bak
new file mode 100644
index 00000000..bcd3b7f3
--- /dev/null
+++ b/docs/Compling_tesseract_and_leptonica.md.bak
@@ -0,0 +1,59 @@
+# Compling tesseract and leptonica.md
+* [Index](./ReadMe.md)
+
+## Notes
+Build instructions for Tesseract 4.1.1 and leptonica 1.80.0. Please note that build systems do change so while the following
+has been tested with the listed versions building against any other versions including master may not work as expected and
+aren't supported.
+
+The following also differ from [[Compiling-Tesseract-and-Leptonica]] in that they use vcpkg to manage the dependencies.
+The main benefit of this is that it's possible to compile tesseract against the leptonica dll rather than statically
+linking leptonica into tesseract which increases file size (since the leptonica dll is still required).
+
+1. Install Visual Studio 2022
+2. Install CMake (ensure it's on your path)
+3. Install [vcpkg](https://github.com/Microsoft/vcpkg/)
+ * Note: I also set an environment variable VCPKG_HOME to this directory and added it to path for convenience
+
+4. Build Leptonica:
+
+ ```
+ vcpkg install giflib:x86-windows-static libjpeg-turbo:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static tiff:x86-windows-static zlib:x86-windows-static
+ vcpkg install giflib:x64-windows-static libjpeg-turbo:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static tiff:x64-windows-static zlib:x64-windows-static
+ git clone https://github.com/DanBloomberg/leptonica.git & cd leptonica
+ git checkout -b 1.82.0 1.82.0
+ mkdir vs16-x86 & cd vs16-x86
+ cmake .. -G "Visual Studio 17 2022" -A Win32 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x86
+ cmake --build . --config Release --target install
+ cd ..
+ mkdir vs16-x64 & cd vs16-x64
+ cmake .. -G "Visual Studio 17 2022" -A x64 -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_INSTALL_PREFIX=..\..\build\x64
+ cmake --build . --config Release --target install
+ ```
+4. Build Tesseract:
+
+
+ ```
+ git clone https://github.com/tesseract-ocr/tesseract.git
+ cd tesserct
+ git checkout -b 5.2.0 5.2.0
+ mkdir vs17-x86 & cd vs17-x86
+ cmake .. -G "Visual Studio 17 2022" -A Win32 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x86
+ cmake --build . --config Release --target install
+ cd ..
+ mkdir vs17-x64 & cd vs17-x64
+ cmake .. -G "Visual Studio 17 2022" -A x64 -DAUTO_OPTIMIZE=OFF -DSW_BUILD=OFF -DBUILD_TRAINING_TOOLS=OFF -DCMAKE_INSTALL_PREFIX=..\..\build\x64
+ cmake --build . --config Release --target install
+ ```
+
+### Leptonica Notes:
+
+* Leptonica now needs to be built to use shared libraries (dlls) explicitly, this is accomplished by setting the ``BUILD_SHARED_LIBS`` to ``ON`` (``-DBUILD_SHARED_LIBS=ON``)
+* Using [Self build](https://github.com/SoftwareNetwork/sw) hasn't been tested and is disabled using ``SW_BUILD=OFF``.
+
+### Tesseract Notes:
+
+* For portability architecture optimizations have been disabled using ``-DAUTO_OPTIMIZE=OFF`.
+ This however will disable platform specific optimizations (AVX, SSE4.1, etc) which would likely
+ result in better performance if your guarantied they will be available.
+* Like leptonica Self Build has also been disabled using ``-DSW_BUILD=OFF``.
diff --git a/src/InternalTrace.3044.log b/src/InternalTrace.3044.log
new file mode 100644
index 00000000..e69de29b
diff --git a/src/InternalTrace.3144.log b/src/InternalTrace.3144.log
new file mode 100644
index 00000000..e69de29b
diff --git a/src/InternalTrace.3536.log b/src/InternalTrace.3536.log
new file mode 100644
index 00000000..e69de29b
diff --git a/src/InternalTrace.7132.log b/src/InternalTrace.7132.log
new file mode 100644
index 00000000..e69de29b
diff --git a/src/InternalTrace.8476.log b/src/InternalTrace.8476.log
new file mode 100644
index 00000000..e69de29b
diff --git a/src/Tesseract.Drawing/Tesseract.Drawing.csproj b/src/Tesseract.Drawing/Tesseract.Drawing.csproj
index 48218f7e..8994ed0e 100644
--- a/src/Tesseract.Drawing/Tesseract.Drawing.csproj
+++ b/src/Tesseract.Drawing/Tesseract.Drawing.csproj
@@ -14,8 +14,8 @@
https://github.com/charlesw/tesseract/
https://github.com/charlesw/tesseract/
Tesseract Ocr
- 4.1.1
- 4.1.1.0
+ 5.2.0
+ 5.2.0
Apache-2.0
Tesseract
@@ -35,7 +35,7 @@
-
+
diff --git a/src/Tesseract.Net48Tests/Tesseract.Net48Tests.csproj b/src/Tesseract.Net48Tests/Tesseract.Net48Tests.csproj
index 7972d311..1fe3f4bb 100644
--- a/src/Tesseract.Net48Tests/Tesseract.Net48Tests.csproj
+++ b/src/Tesseract.Net48Tests/Tesseract.Net48Tests.csproj
@@ -28,8 +28,8 @@
-
-
+
+
@@ -40,12 +40,12 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
@@ -210,12 +210,12 @@
-
-
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Tesseract.NetCore31Tests/Tesseract.NetCore31Tests.csproj b/src/Tesseract.NetCore31Tests/Tesseract.NetCore31Tests.csproj
index c40babdf..230aa7bb 100644
--- a/src/Tesseract.NetCore31Tests/Tesseract.NetCore31Tests.csproj
+++ b/src/Tesseract.NetCore31Tests/Tesseract.NetCore31Tests.csproj
@@ -37,9 +37,9 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Tesseract.Tests/Leptonica/ColorTests.cs b/src/Tesseract.Tests/Leptonica/ColorTests.cs
index b7c8b14a..637c1cf3 100644
--- a/src/Tesseract.Tests/Leptonica/ColorTests.cs
+++ b/src/Tesseract.Tests/Leptonica/ColorTests.cs
@@ -22,7 +22,7 @@ public void Color_CastColorToNetColor()
Assert.That(castColor.A, Is.EqualTo(color.Alpha));
}
#endif
-
+
[TestCase]
public void Color_ConvertColorToNetColor()
{
@@ -33,5 +33,16 @@ public void Color_ConvertColorToNetColor()
Assert.That(castColor.B, Is.EqualTo(color.Blue));
Assert.That(castColor.A, Is.EqualTo(color.Alpha));
}
+
+ [TestCase]
+ public void Color_ConvertNetColorToColor()
+ {
+ var color = System.Drawing.Color.FromArgb(100, 150, 200);
+ var castColor = color.ToPixColor();
+ Assert.That(color.R, Is.EqualTo(castColor.Red));
+ Assert.That(color.G, Is.EqualTo(castColor.Green));
+ Assert.That(color.B, Is.EqualTo(castColor.Blue));
+ Assert.That(color.A, Is.EqualTo(castColor.Alpha));
+ }
}
}
diff --git a/src/Tesseract.sln b/src/Tesseract.sln
index 3b688235..7e7a49be 100644
--- a/src/Tesseract.sln
+++ b/src/Tesseract.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29409.12
+# Visual Studio Version 17
+VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tesseract", "Tesseract\Tesseract.csproj", "{AB8F7CF1-E75B-4BD3-8853-2348ECDEA969}"
EndProject
diff --git a/src/Tesseract/Tesseract.csproj b/src/Tesseract/Tesseract.csproj
index dd272f0e..4cfadc8d 100644
--- a/src/Tesseract/Tesseract.csproj
+++ b/src/Tesseract/Tesseract.csproj
@@ -1,6 +1,6 @@
- netstandard2.0;net40;net45;net48
+ netstandard2.0;net47;net48
true
@@ -9,25 +9,21 @@
Charles Weld
Tesseract
- Tesseract 4 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.
+ Tesseract 5 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.
Copyright 2012-2020 Charles Weld
https://github.com/charlesw/tesseract/blob/master/ChangeLog.md
https://github.com/charlesw/tesseract/
https://github.com/charlesw/tesseract/
Tesseract Ocr
- 4.1.1
- 4.1.1.0
+ 5.2.0
+ 5.2.0
Apache-2.0
-
-
- NET40;NETFULL;SYSTEM_DRAWING_SUPPORT
-
-
-
- NET45;NETFULL;SYSTEM_DRAWING_SUPPORT
+
+
+ NET47;NETFULL;SYSTEM_DRAWING_SUPPORT
@@ -71,4 +67,4 @@
Never
-
\ No newline at end of file
+
diff --git a/src/Tesseract/x64/leptonica-1.82.0.dll b/src/Tesseract/x64/leptonica-1.82.0.dll
index 80060237..64f449cd 100644
Binary files a/src/Tesseract/x64/leptonica-1.82.0.dll and b/src/Tesseract/x64/leptonica-1.82.0.dll differ
diff --git a/src/Tesseract/x64/tesseract.exe b/src/Tesseract/x64/tesseract.exe
index f692483a..48af3bbc 100644
Binary files a/src/Tesseract/x64/tesseract.exe and b/src/Tesseract/x64/tesseract.exe differ
diff --git a/src/Tesseract/x86/leptonica-1.82.0.dll b/src/Tesseract/x86/leptonica-1.82.0.dll
index 0e4d2728..d244fa29 100644
Binary files a/src/Tesseract/x86/leptonica-1.82.0.dll and b/src/Tesseract/x86/leptonica-1.82.0.dll differ
diff --git a/src/Tesseract/x86/tesseract.exe b/src/Tesseract/x86/tesseract.exe
index c7de1f71..4c5ef2b5 100644
Binary files a/src/Tesseract/x86/tesseract.exe and b/src/Tesseract/x86/tesseract.exe differ