Hello,
Hi Naradamahamuni,
Thank you for your inquiry.
Please follow the links below for details on how to extract text from image using JAVA.
I taken some vehicle number plate images but im unable to get that text as my o/p .
here is the sample images
Hi Naradamahamuni,
Thank you for sharing samples with us.
This is to update you that the current implementation of the Aspose.OCR API works well with images having resolution of at least 300 DPI and the accuracy rate tends to decrease by decreasing the resolution. It will not be possible to get 100% accuracy if you wish to scan the complete image. On the other hand, if you intend to get some specific contents from a portion of the image, you can use the custom recognition blocks to get better accuracy.
Please note, the above mentioned solution is useful in scenario when you have documents/images following the similar structure, that is; the contents to be scanned are always on the same location for each image.
In your case I would suggest that you should pass boundaries of the license plate to the OCR engine [i.e. custom recognition blocks] rather than relying on automatic detection. Furthermore with defined boundaries you can further optimize processing by providing the list of possible characters in the plate as a whitelist in OcrConfig. The license plates usually have a restricted set of allowed characters that are only upper-case alphabets and digits from 0 to 1.
hello,
java.lang.ClassNotFoundException: com.aspose.ocr.OcrEngine
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
com.igate.UploadServlet.doPost(UploadServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
hello ikram,
Hi Naradamahamuni,
Thank you for writing us back.
Yes you can convert IRecognizedText to string. Converting it to string will return whole recognized text without formatting. For more information please visit the link Interface IRecognizedText
.
Could you please share the code snippet with which you tried to extract text from the image. We will further test the scenario in our environment and address it accordingly.
Asad any updates on the query which i have sent.
public class PerformOCROnImage {
public static void main(String[] args) throws Exception {
// ExStart:PerformOCROnImage
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(PerformOCROnImage.class);
// The image path
String imagePath = dataDir + “Sample.jpg”;
// Create an instance of OcrEngine
OcrEngine ocr = new OcrEngine();
// Set the Image property
ocr.setImage(ImageStream.fromFile(imagePath));
// Perform OCR and get extracted text
try {
if (ocr.process()) {
System.out.println(ocr.getText());
}
} catch (Exception e) {
e.printStackTrace();
}
// ExEnd:PerformOCROnImage
}
}
Thanks for sharing sample code snippet.
We have tested the scenario in our environment and noticed that text was not recognized correctly. Furthermore, we have also noticed that your image is of 72 DPI. Please note that Aspose.OCR for .NET performs better and gives expected results with the images of 300 DPI minimum. Would you please try using image with greater DPIs and in case you still face any issue, please feel free to let us know.
An issue with ID OCR-718 has been logged in our issue management system for it. We will surely look into details of the issue and keep you posted with the status of its correction. Please spare us little time.
We are sorry for the inconvenience.