← Back to team overview

sikuli-driver team mailing list archive

[Question #691094]: Extracting text from the image

 

New question #691094 on Sikuli:
https://answers.launchpad.net/sikuli/+question/691094

I tried to extract a text from a captcha  using Sikuli using java. I tried the below code but it doesn;t worked for me. Can any one here review the code & let me know what should be modifued. I am sure this code is partially correct & when I run this code I could see the below exception in eclipse console. Please help.

[error] TextRecognizer: init: export tessdata not possible - run setup with option 3
[error] TextRecognizer not working: tessdata stuff not available at:
C:\Users\user\AppData\Roaming\Sikulix\SikulixTesseract\tessdata
[error] text: text recognition is now switched off
--- no text ---

please find the below code:

public class Text {

	
	public static void main(String[] args) throws FindFailed {
	
		Settings.OcrTextRead=true;
		Settings.OcrLanguage = "eng";
		
		WebDriverManager.chromedriver().setup();

		WebDriver driver = new ChromeDriver();
		driver.get("http://www.captcha.net/";);
		driver.manage().window().maximize();
		driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);
		


		Pattern d= new Pattern("G:\\Capture.PNG");
		
		Screen scr= new Screen();
		String str=scr.find(d).text();

		System.out.println(str);
		
	}
}

Please find the below link for the image which I need to extract text from the image.
https://i.ibb.co/dfdpT0h/Capture.png

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.