evermeer / PassportScanner

Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
BSD 3-Clause "New" or "Revised" License
457 stars 101 forks source link

After scanning for some seconds with a Scan quality insufficient : 0.0, I get a "GPUImageFramebuffer unlock" Exception. #3

Closed kikolobo closed 7 years ago

kikolobo commented 8 years ago

2016-03-21 17:50:02.556 PassportScanner[9842:4849034] * Assertion failure in -[GPUImageFramebuffer unlock], /Users/frlobo/Downloads/PassportScanner-master-2/Pods/GPUImage/framework/Source/GPUImageFramebuffer.m:269 2016-03-21 17:50:02.558 PassportScanner[9842:4849034] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?' *\ First throw call stack: (0x18382d900 0x182e9bf80 0x18382d7d0 0x1841a099c 0x100197c80 0x100197e2c 0x184ac447c 0x184ac3510 0x18370d664 0x184ac3210 0x18370d664 0x18851cc24 0x182eb5ae8 0x18371142c 0x18411741c 0x1841d6728 0x101b65bb0 0x101b6b658 0x1837e4bb0 0x1837e2a18 0x183711680 0x184c20088 0x188588d90 0x1001005e4 0x1832b28b8) libc++abi.dylib: terminating with uncaught exception of type NSException

evermeer commented 8 years ago

I have done some work on this issue before. See issue #2 Apparently this is a known issue for the GPUImage library Is the crash in your case reproducible or was it an one time instance? I have a problem reproducing this issue. Could you tell me what your iPhone, iOS and XCode version is?

kikolobo commented 8 years ago

Sure. iPhone 6S It is intermittent error, unpredictable when it will happen.

I am also having a hard time detecting passports on paper. On screen it's easier although not super easy.

I haven't been able to scan a paper passport.

When I get success can the 7 it's confused by a 1.

I will give it more in depth tries in different lighting conditions.

Thanks for the library, I will try to contribute as much as I can.

evermeer commented 8 years ago

I have had very good results with an iPhone 6 (see video) but on a 5 the result was also not so optimal. The OCR library has some specific requirements for the image in order to make a good scan. It feels like i have to test different settings and use those based on the device version.

Freedom4eva commented 8 years ago

Way is this On 22 Mar 2016 9:52 am, "Kiko Lobo" notifications@github.com wrote:

2016-03-21 17:50:02.556 PassportScanner[9842:4849034] * Assertion failure in -[GPUImageFramebuffer unlock], /Users/frlobo/Downloads/PassportScanner-master-2/Pods/GPUImage/framework/Source/GPUImageFramebuffer.m:269 2016-03-21 17:50:02.558 PassportScanner[9842:4849034] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?' *\ First throw call stack: (0x18382d900 0x182e9bf80 0x18382d7d0 0x1841a099c 0x100197c80 0x100197e2c 0x184ac447c 0x184ac3510 0x18370d664 0x184ac3210 0x18370d664 0x18851cc24 0x182eb5ae8 0x18371142c 0x18411741c 0x1841d6728 0x101b65bb0 0x101b6b658 0x1837e4bb0 0x1837e2a18 0x183711680 0x184c20088 0x188588d90 0x1001005e4 0x1832b28b8) libc++abi.dylib: terminating with uncaught exception of type NSException

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/evermeer/PassportScanner/issues/3

kikolobo commented 8 years ago

I am trying to do my scanning on an iPhone 6S. I am guessing that an approach might be to ask the user to take a picture of the passport and then have the app analyze it instead of capturing video frames. This has the advantage of better quality in the picture, and also you can filter the image in say... 10 different ways and see which one of the scans pass the success test and use those results....

I am going to try and find the time to contribute and help you with this.

evermeer commented 8 years ago

Now that there is a GPUImage2 library I will try to convert to that one.

evermeer commented 7 years ago

There is now a GPUImage2 branch where I am using the GPUImage library. The code now looks a lot cleaner (pure swift) It still has a problem that I need to fix. It's only scanning the left part of the processed image.

evermeer commented 7 years ago

The GPUImage2 branch is now stable and gives good results.

evermeer commented 7 years ago

The GPUImage2 version is now merged to master and released as version 2.0.1