-
Notifications
You must be signed in to change notification settings - Fork 23
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
Floating Point operations on iOS / Safari #25
Comments
Thanks for the feedback |
Thank you so much for the quick response! A few more things that may or may not be related.
This library deserves some serious traction. I haven’t come across another library that’s as screaming fast as this, and trust me I’ve looked hard ;). |
The reason we created this library is we weren't able to find an alternative, nice to see you it works for you |
I am curious can you tell us more about your project? |
For sure. Working on an app to help law enforcement officers document vehicle collisions. Currently, they either use paper and pencil or really terrible software. There is a lot of information they have to record, and the drivers licenses are the most time consuming part. I’ve looked into many different ways to scan the drivers license but I have the following limitations.
It’s actually been quite challenging, and of all of the methods I’ve tried, I’m placing my bets on a high quality still photo of the front and back of the license that is properly extracted and transformed so that I can then do feature extraction of the PDF417 barcode to accurately decode it. I can then compare that with an ocr result of the front for accuracy and probably throw in a bit of machine learning for good measure. |
Thanks for the description. We could provide a reusable component that does this (and more). Ping me at [email protected] or rmhrisk on Skype. |
@jamesmfriedman issue should be fixed in #26, please check it out using your code |
@WorldThirteen found a couple possible reasons which make line detection broken on mobile Safari and we will try to solve it ASAP Look like you have a kind of morphologic filtering, do you use some post-processing after Canny Edges? |
I am :). Got to this result by playing around, but here is my pipeline. I think I know what close does (erodes black towards center), but either way it seems almost like magic that I get that clean of an image. The dilation was an attempt for pcLines to see the lines nice and clear although it doesn't seem to help much. let pipeline = input;
pipeline = gm.grayscale(pipeline);
pipeline = gm.norm(pipeline, 'l2');
pipeline = gm.gaussianBlur(pipeline, 3, 3);
pipeline = gm.morphologyEx(pipeline, 'close', [51, 51]);
pipeline = gm.sobelOperator(pipeline);
pipeline = gm.cannyEdges(pipeline, 1, 1);
pipeline = gm.dilate(pipeline, [5, 5]);
pipeline = gm.downsample(pipeline, 2); |
@jamesmfriedman, in the latest release (0.3.2) we enhanced the precision of floats, so now lines detection works fine on iOS, please check. |
Everyone, thank you for the prompt responses and fixes. There are still minor abnormalities likely dealing with Floating point math on iOS, but i will emphasize MINOR. I'm able to hack around the small differences now and am officially unblocked! :) Thanks you so so much for your help on this and the quick turn around. Really an amazing library, loving using it. |
Please file bug regarding abnormalities |
I can just reopen then. Sorry I don't have more info on this, I can post a screenshot tomorrow morning. Basically, iOS finds most of the lines properly, and still occasionally sees a line that isn't there. I want to say that the issue is present on Desktop Safari as well. Standby... |
@jamesmfriedman, please give more description, screenshots, environment details (device, OS and browser versions). |
Sorry for the late reply, I've currently abandoned trying to do automatic document extraction via pcLines. I know when I was doing this with HoughLines and openCV, there were minimum thresholds / distances I could set that would allow it to filter out a lot of the noise. Given my example image above, I don't think I can get any clearer of an image, and still Chrome and Safari both detect things that are barely there. Looking at the OpenCV api, it was a combination of rho and theta that would allow me to achieve this. I guess this bug is turning into more of a feature request? |
Your library is my last hope in solving my problems for this app.
Basically, I'm trying to do an extraction of a card using hough lines and finding the intersection of the points. A few things.
Good Example (Chrome), I'm able to extract the license using the pclines.
Bad Example (Safari). Same exact code, wildly different result. You'll notice the lines (in the top right image) don't seem to correspond to anything.
Any help you could possibly give would be amazing. I wasted several weeks trying to get openCV js working before finally giving up. Found your library after, was able to get to the same point I was at with openCV in half a day, and the performance is incredible.
The text was updated successfully, but these errors were encountered: