abbyy / ocrsdk.com Goto Github PK
View Code? Open in Web Editor NEWABBYY Cloud OCR SDK
Home Page: http://ocrsdk.com/github
License: Apache License 2.0
ABBYY Cloud OCR SDK
Home Page: http://ocrsdk.com/github
License: Apache License 2.0
Hello,
Everything is in the title.
Thank you
All of the provided SDKs are only capable of handling one exportFormat. But the API supports to specify up to three exportFormats. It would be nice if we also had this capability in the SDK.
Hi Team,
I am using android sample but i want response in json format. It gives me an error (Error: Unexpected token (position:TEXT {"taskId":"e33b1...@1:194 in java.io.BufferedReader@5b716f5) ) while using json V2 process image method.
Kindly provide me a solution or working sample of Abby OCR so that we can finish our POC and integrate your solution with in our product.
Thanks,
Hi,
It is stated on ABBYY's website that Receipt Recognition is currenlty being beta tested for many countries, including Canada.
However, the Receipt Recognition Demo app does not allow to select Canada as the receipt country of origin.
I added "Canada" to the CountryOfOrigin enum: an error occurs "Invalid receipt country: Canada".
Could you please have a look at this?
Thank you :)
A.
When I load abbyy_php_example.php in a browser I only get "failed creating formpost data" I can't figure out what this error means. Thank you for your help.
I am trying to read German id (passport) in which I want to get user's information like the first name, last name, DOB, country, city, street, etc. this information will be used for creating a user so you have any idea to how to recognize user details from German id passport?
I am reading below image:
So is there any way to find the user's details?
I've bridged the Objective C files with a Swift project. I was able to bridge everything correctly. However, I was having issues with executing the delegate methods in Swift. In order to invoke the delegate methods, I had to change
@property (assign) id<ClientDelegate> delegate;
to
@property (strong, nonatomic) id<ClientDelegate> delegate;
in Client.h
Before I made this change, the delegate methods weren't getting invoked in the Swift code at all.
In other words, the respondsToSelector
methods always returned false.
if ([self.delegate respondsToSelector:@selector(clientDidFinishUpload:)]) { [self.delegate clientDidFinishUpload:self]; }
I'm no expert at Objective C and I'm not entirely sure this is a defect (considering I'm bridging the Objective C source with Swift). I wanted to make sure this change was correct for my scenario.
Please advise. Thanks in advance.
Chris
Hi,
I'm just trying the Windows Phone sample, and I get a
Processing error: The remote server returned an error: NotFound
after sending an image. Is this a problem on your side ?
I used two methods:
from ABBYY import CloudOCR
ocr = CloudOCR(application_id=<my_app_id>, password=<my_abbyy_password>)
pdf = open('blah.pdf', 'rb')
file = {pdf.name: pdf}
result = ocr.process_and_download(
file,
exportFormat='xml,pdfTextAndImages',
language='English'
)
print(result)
the value used above in <my_app_id>
was the value found on the Application Settings page of my Abbyy Cloud OCR SDK Console, as described here: https://abbyy.technology/en:products:cloud-ocr:where_can_i_find_the_appid
which resulted in
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://cloud.ocrsdk.com/processImage?exportFormat=xml%2CpdfTextAndImages&language=English
ABBYY_APPID
and ABBY_PWD
):python process.py -pdf blah.pdf result.txt
which results in
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://cloud-westus.ocrsdk.com/processImage?language=English&exportFormat=pdfSearchable
My guess would be some sort of authentication issue. I'm not sure if I'm using the right application ID, but I'm not sure what else I'd use.
The iOS example uses: pod "OCRSDKClient", "0.2.1"
That pod uses AFNetworking v1.3.
Do you have any plans to update that to support AFNetworking v2.x?
I am trying to transfer code from ProcessingParams to a URLViewController that I created to allow users to select different language libraries and output format through UIbuttons.
However when I created these codes into viewcontroller, it throws out error about invalid parameter of taskID. Wondering how I should change the parameters?
OcrSdkDemo[4003:1654971] *** Assertion failure in -[Client uploadFinished:], /Users/SteveAndrewWong/Desktop/OcrSdkDemo copy 2/Sources/Client.m:111
2015-12-26 18:28:11.633 OcrSdkDemo[4003:1654971] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: task.ID'
I have given internet permission in manifest but still getting this issue
any suggestion pls.
It is pretty cool, that abbyy provides a NodeJS library for their API and so far it also worked well for us!
We currently have issues, that the processImage task is not working for certain users and the error handling of the ocrsdk.js is a bit buggy itself, as the error message is show as [Object object].
So it is hard to debug right now, without monkey patching the library.
Probably there is a missing "toString()" after message or something?
taskDataCallback(new Error(response.error.message), null);
Posted on the forum 4 days ago (where there are 761 open questions without an accepted answer to 899 answers, hence cross post) http://forum.ocrsdk.com/questions/4649/full-layout-and-text-region-classification-capability-of-cloud-ocr-skd.
I'm trying to recognise semantic information about text regions e.g. headers, footers, page numbers, captions etc. I cannot find any information about how to achieve this in the documentation. Please can you provide a python code example?
I'm currently using the supplied python example here: http://ocrsdk.com/documentation/code-samples/. N.B. In order to get this Python code to work, I had to change line 90 of AbbyyOnlineSdk.py from
return {"Authorization": "Basic %s" % base64.encodestring( ...
to
return {"Authorization": "Basic %s" % base64.b64encode( ...
I'm currently just executing this call:
python process.py infile.png outfile.xml -l English -xml
Vector argList = new Vector(Arrays.asList(args));
args how to add parameter
i m using abby's code sample for android. i clicked the "from camera" button. its working fine. But i clicked "from file",i choose the image but then nothing happens just shows activity result.
i solved my problem. but now i have a new problem. this is the first problem solution
go to MainActivty.java and change
Cursor cur = managedQuery(imageUri, projection, null, null, null);//(imageUri return null, lolipop issues i think)
to
Cursor cur = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, null);
my second problem is ; my photo uploading correctly but response return empty. i can't find the problem please yours android developer can see this problem
I am using the same code as abbyy_ruby_example.rb and just changed :
APPLICATION_ID = CGI.escape("[email protected]")
PASSWORD = CGI.escape("feRm4kNP")
FILE_NAME = "/var/www/scaled_scores/output.pdf"
Error i am getting is
Uploading file..
/home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in return!': 401 Unauthorized (RestClient::Unauthorized) from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in
process_result'
from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in block in transmit' from /home/eossysd7/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:745:in
start'
from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in transmit' from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in
execute'
from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in execute' from /home/eossysd7/.rvm/gems/ruby-1.9.3-p194@veritas/gems/rest-client-1.6.7/lib/restclient.rb:72:in
post'
from ocr.rb:47:in `
Please do take a look at it and will be looking forward for assistance
Regards
Nishanth
In order to get this to work (to stop a newline being added to the header making it invalid), had to change line 90:
from:
return { "Authorization" : "Basic %s" % base64.encodestring( "%s:%s" % (self.ApplicationId, self.Password) ) }
to:
return { "Authorization" : "Basic %s" % base64.b64encode( "%s:%s" % (self.ApplicationId, self.Password) ) }
System details:
Mac 10.10.4
Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Error message:
Traceback (most recent call last):
File "process.py", line 94, in
recognizeFile( sourceFile, targetFile, language, outputFormat )
File "process.py", line 40, in recognizeFile
task = processor.ProcessImage( filePath, settings )
File "/Users/kungfujam/git/ocrsdk.com/Python/AbbyyOnlineSdk.py", line 52, in ProcessImage
response = self.getOpener().open(request, bodyParams).read()
File "/Users/kungfujam/anaconda/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/Users/kungfujam/anaconda/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/Users/kungfujam/anaconda/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/Users/kungfujam/anaconda/lib/python2.7/urllib2.py", line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/Users/kungfujam/anaconda/lib/python2.7/urllib2.py", line 1194, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/Users/kungfujam/anaconda/lib/python2.7/httplib.py", line 1053, in request
self._send_request(method, url, body, headers)
File "/Users/kungfujam/anaconda/lib/python2.7/httplib.py", line 1092, in _send_request
self.putheader(hdr, value)
File "/Users/kungfujam/anaconda/lib/python2.7/httplib.py", line 1031, in putheader
raise ValueError('Invalid header value %r' % (one_value,))
ValueError: Invalid header value 'Basic dXNlcjpwYXNzd29yZA==\n'
Is there going to be a swift version of sample code?
I have app, which has requirement of scan business card and convert it in contact, this sdk full fill my requirement but that not enough, we need scan business card offline as without having a internet, so will it possible with this sdk, if yes, then please let me know how?
Thanks.
Hello,
My App id is 6edc25b1-9014-4e32-9eed-746d5aada041
I started a new trial this morning via the Cloud OCR SDK.
I used the code sample provided for cURL and replaced the App Id and Password to mine (in the snippet)
I cURLed : sh curl_recognize.sh "HPSCAN_101420113211.pdf" "aa_test.txt"
But no matter what i tried I kept receiving the response:
Error uploading file
Could you please advise of why am I receiving that?
Also, Is there a place where I can see the Error Logs?
Thanks,
Anthony
I coded as follows
ocr_engine = CloudOCR(application_id='', password='')
jpg = open('pic16.JPG', 'rb')
file = {jpg.name: jpg}
result = ocr_engine.process_and_download(file, exportFormat='xml&xml:writeFormatting=true', language='English')
result
for format, content in result.items():
with open('converted.xml', 'wb') as output_file:
output_file.write(content.read())
output_file.close()
it threw the following Error:
HTTPError: 450 Client Error: Unknown format xmlwriteFormatting=true for url: http://cloud-eu.ocrsdk.com/processImage?exportFormat=xmlwriteFormatting%3Dtrue&language=English
Hi..
I am new in android. I want to make an application which perform ocr.
So i m used your provision..
But when i run app after configuring everything i ll get nothing..no text i m getting after image sucessfully scan..
In logcat it shows : log-entry-corrupt-or-truncated
and
computeValuesWithHarfbuzz — need to force to single run” in Android 4: What does this mean?
How to solve this
please reply m waiting..
Provided test.js file, running on local computer throws an error on line 58:
TypeError: Parameter 'url' must be a string, not object
at Url.parse (url.js:107:11)
at Object.urlParse as parse (url.js:101:5)
at ocrsdk.downloadResult (/Users/larisachristie/node_js/ocrsdk.js:148:19)
at processingCompleted (/Users/larisachristie/node_js/test.js:58:6)
at /Users/larisachristie/node_js/ocrsdk.js:126:5
at IncomingMessage.parseXmlResponse (/Users/larisachristie/node_js/ocrsdk.js:221:3)
at IncomingMessage.EventEmitter.emit (events.js:95:17)
at IncomingMessage.<anonymous> (_stream_readable.js:746:14)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
Fixed with adding .toString() method to taskData.resultUrl:
ocrsdk
.downloadResult(taskData.resultUrl.toString(), outputPath,
downloadCompleted);
Happy new year, everyone!
I thank the team for providing this iOS sample project.
I tried to run the project and recognize the sample image in the app.
But I got the following error:
2017-01-06 19:01:01.027 OcrSdkDemo[9668:1150661] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: task.downloadURL'
So I debugged the project, and found that task.downloadURL is null at runtime.
The following is the code snippet where task.downloadURL is null.
The code snippet is in the Client.m file.
(void)processingFinished:(HTTPOperation*)operation
{
if (operation.error != nil) {
if ([self.delegate respondsToSelector:@selector(client:didFailedWithError:)]) {
[self.delegate client:self didFailedWithError:operation.error];
}
} else {
Task* task = [[Task alloc] initWithData:operation.receivedData];
if ([self.delegate respondsToSelector:@selector(clientDidFinishProcessing:)]) {
[self.delegate clientDidFinishProcessing:self];
}
NSParameterAssert(task);
NSParameterAssert(task.downloadURL);
Is there anything I missed? I replaced the app id and password.
I should be grateful if you could help me fix this issue as soon as possible.
Thank you for your time and help.
Hi,
I am unable to figure out how do I use this to read US Driving license and credit card information from an image. I tried using barcode for backside DL image but it did not work. Please help me with this.
Thanks
I am using ocr for android.
After changing application id and password i am getting the below error:
Error:/data/data/abbyy.ocrsdk.android/files/result.txt:open failed:ENOENT(No such file or directory)
$ ./curl_recognize.sh in.jpeg /tmp/out.txt
ABBYY Cloud OCR SDK demo recognition script
Recognizing ticket.jpeg with english language. Result will be saved in txt format..
Uploading..
Uploaded, task id is 'e6229a2e-9e51-4598-a654-c017f39a22b2'
Waiting...
Done.
$
The resulting out.txt
is empty however.
$ ls -l
-rw-r--r-- 1 harm harm 3 3 nov 15:25 out.txt
I've caught the final response of the server too to verify and that seems good:
<?xml version="1.0" encoding="utf-8"?><response><task id="e6229a2e-9e51-4598-a654-c017f39a22b2" registrationTime="2016-11-03T14:25:11Z" statusChangeTime="2016-11-03T14:25:11Z" status="Completed" filesCount="1" credits="0" resultUrl="https://ocrsdk.blob.core.windows.net/files/e6229a2e-9e51-4598-a654-c017f39a22b2.result?sv=2012-02-12&se=2016-11-04T00%3A00%3A00Z&sr=b&si=downloadResults&sig=nX41da296fqCkG6pqTU3oS%2FyOqSokORVl9VCUJgywoE%3D" /></response>
Any help?
Hi,
I need to work with javascript code provided and I am facing difficulties in using the javascript code.
Can anyone please guide me how I can work with this piece of code.
I already execute the command "npm install xml2js"
I shall be vary thankful for the kind help.
Thanks
Hi
We've been using the Android sample code to communicate with ABBY OCR. But we noticed that in the plain/text result of the downloadResults
request at the beginning of the text there's always a ZERO WIDTH NO-BREAK SPACE (U+FEFF) character that we had to remove.
Why is that character in the response?
Our current "solution" is to remove the character in the ResultsActivity
contents.toString().replaceFirst("\uFEFF", "")
on line 292
result += '?' + this.customOptions;
should be:
result += '&' + this.customOptions;
also, i think its better to have customOption an object of key/value and not have the user of the library aware of the URLish nature of the fields. (so user does not need to know to add & for multiple custom options).
I want to run the JS sample with node and every time I execute "node test.js" it says:
"DeprecationWarning: sys is deprecated. Use util instead.
Error: connect ECONNREFUSED 127.0.0.1:443"
Im sure that I entered the correct AppID and the correct password.
As url I am using http://cloud-eu.ocrsdk.com/.
Thanks for your help.
I imported android abbyy file.But it hasn't any layout folder.How can I solve this problem.All code that related to layout is underlined by Eclipse.
Is there any solution for this ?
python .\Python\process.py AFS COI-page-001.jpg myfil
e -rtf
Traceback (most recent call last):
File ".\Python\process.py", line 8, in
import MultipartPostHandler
File "C:\Python\MultipartPostHandler.py", line 73
raise TypeError, "not a valid non-string sequence or mapping object", traceb
ack
^
SyntaxError: invalid syntax
I'm using OCRSDK for iOS but for iOS Version 9.2.1, it is crashing and even in the given demo, it is crashing. anyone have faced issue ?
Please help me to resolve this issue.
I've tried several times now, to open resultUrl which I get from scanning business card. Everytime I get
<?xml version="1.0" encoding="utf-8"?> <error> InvalidAuthenticationInfo <message>Authentication information is not given in the correct format. Check the value of Authorization header. RequestId:19048c46-0001-000f-5576-2b1fec000000 Time:2015-11-30T13:56:28.6142735Z</message> </error>
So, what am I doing wrong then?
I'm using $http requests through Angular App. I've tried to request the GET with POSTMAN with the same result.
Thank you for your feedback.
while i run app with use of abbyy's ocrsdk i get above mention error:
Error: unable to resolve host "cloud.ocrsdk.com" No address associate with this host name
how can i solve this..
need urgent help.
args.length is zero how to add parameter in args in TestApp class
Vector argList is also null pointer exception
Implement your project in eclipse for java. implement completion...Please Explain run test app
In iOS sample canAuthenticateAgainstProtectionSpace always return NO because authenticationDelegate is never set and so is nil at all times. The most likely resolution is to just remove canAuthenticateAgainstProtectionSpace - the default behavior should be okay.
After I enter my AppID and run demo , app show this error
I used it like this
python process.py a.png -l Chinese -xml a.xml
but failed
С указанием выходного файла
$./curl_recognize.sh picture_samples/Russian/001.jpg out.txt -f txt -l russian
Invalid argument: out.txt
Без указания выходного файла
$./curl_recognize.sh picture_samples/Russian/001.jpg -f txt -l russian
Uploading..
curl: (26) failed creating formpost data
Error uploading file
The file i am using now consists of 5 pages , recognized_text consists of all pages now how to access only the text in 2nd page or any one of the page.
Running the .net sample on windows 8.1 and VS2013 (Update 1). It won't allow me to drop?
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: task.ID'
*** First throw call stack:
(0x185a1f164 0x184c68528 0x185a1f038 0x1863b97f4 0x1003e4930 0x18641b2e4 0x1859c777c 0x1859c76fc 0x1859c6f84 0x1859c4b5c 0x1858e4c58 0x187790f84 0x18f03d5c4 0x1003e6374 0x18540456c)
libc++abi.dylib: terminating with uncaught exception of type NSException
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.