on 2019 Jul 09 6:33 PM
Hello Experts,
I'm trying to implement an OCR for electric/water meter but up to now, I'm having challenges.
I've tried to use Inference Service for Optical Character Recognition (OCR) provided in api.sap.com, but it cannot read digital font or seven segment fonts. then change my approach to use anyline.io sdk (cordova) with sapui5 frontend , but when I saw the pricing, it was costly for us. I also tried, https://github.com/jiweibo/SSOCR , but its not also accurate and need to zoom in the meter reading for better results.
Any better idea for me to make this OCR work?? can I train or tweak options in Inference Service for Optical Character Recognition (OCR) for me to read the digital fort accurately?
Have a productive day ahead,
Chester
Appreciate your help on this
Request clarification before answering.
Hi,
Have you tried the scene text recognition API? It sometimes give better results with content that are not text extracted from traditional documents like invoices, books etc.
Abdel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi chesterarellano
I have put together a SAPUI5 example in the past (but not using Cordova): https://developers.sap.com/tutorials/ml-fs-sapui5-img-classification.html
The idea is to build a new window.FormData() (Multi Part Form Data) where you will append your files using a piece of code like this:
formData.append("files", file, file.name);
The file object can be created using the following API:
file.contentUrl = URL.createObjectURL(object);
Where object is either the image blob or file.
Hope this helps
Hello Abdel,
Thank you for the help. but still my getting an empty responseText from the XMLHttpRequest
not sure on file.name part though.
file.name
I'm getting an error when I just put ' URL.createObjectURL(imageData) ' so I have to make a new Blob out of the imageData using, new Blob(binaryData, {type: "image/jpeg"})
here's my code
try{
var data = new FormData();
var file = {};
var binaryData = [];
binaryData.push(imageData);
file.contentUrl = URL.createObjectURL(new Blob(binaryData, {type: "image/jpeg"}))
file.name = "test.jpg"; //not sure on this part
data.append("files", file);
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
alert(this.readyState);
alert(" a this responseText : " + this.responseText);
alert("xhr responseText : " + xhr.responseText);
}
});
//xhr.onload = function(){
// alert("this responseText : " + this.responseText);
// alert("xhr responseText : " + xhr.responseText);
//}
xhr.withCredentials = true;
xhr.open("POST", "https://sandbox.api.sap.com/mlfs/api/v2/image/scene-text-recognition");
xhr.setRequestHeader("APIKey", "vvCLG42dy1zefnUlrpLpbPCnpFztPwUd");
//sending request
xhr.send(data);
}catch(errr){
alert(errr);
}
Hi chesterarellano
Are you building a Cordova app? Native Android Can you describe how your pictures are taken? Especially what's is giving you the imageData variable.
Also, I found the following link on StackOverflow that might give you some directions: https://stackoverflow.com/a/30811262/7707413 if you are using Cordova.
User | Count |
---|---|
72 | |
18 | |
10 | |
7 | |
7 | |
4 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.