[sikuli] 183/385: integrated the relevant Tess4J stuff into the project (but not used yet) … more

Gilles Filippini pini at moszumanska.debian.org
Sun Jun 29 19:26:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.

commit 1ff8c25f5e0960bb5ff4b1938b4d0cdc7e5ed806
Author: Raimund Hocke <info at its-me-raiman.de>
Date:   Thu Jan 30 12:12:06 2014 +0100

    integrated the relevant Tess4J stuff into the project (but not used yet) … more
---
 OpenCV4Sikuli/pom.xml                                       |  5 +++--
 Tesseract4Sikuli/pom.xml                                    |  3 ++-
 .../src/main/java/org/sikuli/tesseract/Run.java             | 13 +++++++------
 pom.xml                                                     |  3 ++-
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/OpenCV4Sikuli/pom.xml b/OpenCV4Sikuli/pom.xml
index 3a519fb..63f9b91 100644
--- a/OpenCV4Sikuli/pom.xml
+++ b/OpenCV4Sikuli/pom.xml
@@ -19,11 +19,11 @@
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.sikuli</groupId>
-  <artifactId>SikuliX-OpenCV</artifactId>
+  <artifactId>OpenCV4Sikuli</artifactId>
   <version>2.4.7</version>
 
   <build>
-    <defaultGoal>clean install</defaultGoal>  
+    <defaultGoal>clean install</defaultGoal>
     <plugins>
       <!-- to suppress sources in any case -->
       <plugin>
@@ -49,4 +49,5 @@
       </plugin>
     </plugins>
   </build>
+    <name>OpenCV4Sikuli</name>
 </project>
diff --git a/Tesseract4Sikuli/pom.xml b/Tesseract4Sikuli/pom.xml
index cc86a5a..641c80b 100644
--- a/Tesseract4Sikuli/pom.xml
+++ b/Tesseract4Sikuli/pom.xml
@@ -19,7 +19,7 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>org.sikuli</groupId>
-	<artifactId>Tesseract4Java</artifactId>
+	<artifactId>Tesseract4Sikuli</artifactId>
 	<version>1.1.0</version>
 
 	<dependencies>
@@ -39,4 +39,5 @@
       <version>${project.version}</version>
     </dependency>
 	</dependencies>
+    <name>Tesseract4Sikuli</name>
 </project>
diff --git a/Tesseract4Sikuli/src/main/java/org/sikuli/tesseract/Run.java b/Tesseract4Sikuli/src/main/java/org/sikuli/tesseract/Run.java
index 80f59a4..abb8dce 100644
--- a/Tesseract4Sikuli/src/main/java/org/sikuli/tesseract/Run.java
+++ b/Tesseract4Sikuli/src/main/java/org/sikuli/tesseract/Run.java
@@ -12,9 +12,10 @@ import org.sikuli.script.*;
 
 public class Run
 {
-		static String libPath = "/Users/rhocke/SikuliX/libs";
+		static String basePath = "/Users/rhocke/SikuliX";
+		static String libPath = basePath + "/libs";
 		static String datapath = libPath + "/tessdata";
-		static String testFile = "/eurotext.png";
+		static String testFile = "/tesstest.png";
     static String language = "eng";
     static TessAPI.TessBaseAPI handle;
 
@@ -30,20 +31,20 @@ public class Run
         TessAPI.TessBaseAPIInit3(handle, datapath, language);
 
 //				ScreenImage si = s.userCapture();
-        BufferedImage image = ImageIO.read(new File(libPath + testFile)); //si.getImage();
+        BufferedImage image = ImageIO.read(new File(basePath + testFile)); //si.getImage();
 
         ByteBuffer buf = Image.convertImageData(image);
         int bpp = image.getColorModel().getPixelSize();
         int bytespp = bpp / 8;
         int bytespl = (int) Math.ceil(image.getWidth() * bpp / 8.0);
 
-        TessAPI.TessBaseAPISetPageSegMode(handle, TessAPI.TessPageSegMode.PSM_AUTO);
+        TessAPI.TessBaseAPISetPageSegMode(handle, TessAPI.TessPageSegMode.PSM_SINGLE_LINE);
         TessAPI.TessBaseAPISetImage(handle, buf, image.getWidth(), image.getHeight(), bytespp, bytespl);
-        TessAPI.TessBaseAPISetRectangle(handle, 0, 0, 1024, 800);
+//        TessAPI.TessBaseAPISetRectangle(handle, 0, 0, 1024, 800);
         Pointer utf8Text = TessAPI.TessBaseAPIGetUTF8Text(handle);
 
 				String result = utf8Text.getString(0);
-        System.out.println("Tesseract returned: ]" + result + "[");
+        System.out.println(testFile + " returned: ***[\n" + result + "\n]***");
 
 				TessAPI.TessDeleteText(utf8Text);
         TessAPI.TessBaseAPIDelete(handle);
diff --git a/pom.xml b/pom.xml
index 3a874a5..4e81c68 100755
--- a/pom.xml
+++ b/pom.xml
@@ -217,7 +217,8 @@
 	</profiles>
 
 	<modules>
-		<module>OpenCV</module>
+		<module>OpenCV4Sikuli</module>
+		<module>Tesseract4Sikuli</module>
 		<module>Libs</module>
 		<module>Natives</module>
 		<module>Basics</module>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git



More information about the pkg-java-commits mailing list