-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use GPUImage to enhance scanned documents #49
Comments
I think that we want to limit the use of third party libraries. Could we look into implementing this feature using Apple's APIs? |
I believe it requires OpenCV or other frameworks, but i'll look into it. |
Update on this after I made a test implementation:
|
@Boris-Em GPUImage is a great high-quality library, which is well tested. In my opinion we shouldn’t be too picky in using third-parties like this one |
In theory this could be done in Metal :) |
@justjs, any update on this ? This will be added to the framework / and also in the example? |
@jcampbell05 GPUImage 3 already uses Metal |
Well I was able to make it by using Adaptive thresholding with OpenCV2. (that works for me so far) |
I've started work on a Pull Request that implements this, likely with GPUImage. A few things:
I'll update this issue later if/when I get the basic functionality working. |
Perhaps it may just be enougth for WeScan to have hooks for users to extend for their own need. i.e allow user's to run their own preprocessing code for the image generation via a delegate callback. WeScan keeps 3rd party dependencies out of it's code but users can utilize GPU Image as needed to enhance what is shown in the cropping screen. Could open door for other things like extending the scanning functionality by allowing access to each frame from the buffer (if say someone wanted user to scan QR Codes) |
🤔 While I do somewhat agree with that, I feel like getting the thresholding/enhancing right is something that most developers don't have time for, but would still be useful to most, if not all, people who implement WeScan.
|
Thanks for picking this up @justjs. @jcampbell05, this is a better solution, but it would probably add quite a bit of complexity to the project both for us and our users. If we could avoid it, that'd be great! Could we take a look at implementing this feature ourselves? It doesn't seem like it would be a lot of work. |
Good point. Do we have a list of what they do ? is it just a basic curve adjustment (like you would do in photoshop) ? |
Fair enough @Boris-Em. I've basically finished the GPUImage2 version as a quick proof of concept (it's on justJS:WeScan develop branch), so at least we can see what it looks like for now. I'll see what I can do on the other implementations. |
If anyone wants to play around with it as a demo, I've got adaptive thresholding working with GPUImage2. Make sure to run |
Very happy to announce that I managed to get it working (way quicker than I expected) without GPUImage2! #80 |
Lets close this :) |
Closed as added in #80 |
I think we could use GPUImage(2)'s AdaptiveThresholding to enhance the scanned image (It would be optional).
Example:
The text was updated successfully, but these errors were encountered: