Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Card IO : Set Focus Mode for Non-payment cards #21

Open
dgoldman-pdx opened this issue Apr 17, 2015 · 21 comments
Open

Card IO : Set Focus Mode for Non-payment cards #21

dgoldman-pdx opened this issue Apr 17, 2015 · 21 comments

Comments

@dgoldman-pdx
Copy link
Member

[Issue moved here from card.io-iOS-SDK]
[Issue actually created by @biksappdev]

Hi @dgoldman-ebay , I have been trying to get this going with little luck. So I tried calling the autoFocusOnce as below -

  • (void)startVideoStreamSession { [self.videoStream startSession]; [self.videoStream autofocusOnce]; // If we don't do this, then when the torch was on, and the card read failed, // it still shows as on when this view is re-displayed, even though the ending // of the session turned it off. [self updateLightButtonState]; }

Also, // if (!self.currentlyAdjustingFocus && frame.focusSucks && [self hasAutofocus]) {
NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
// if (now - self.lastAutoFocusOnceTime > kMinTimeIntervalForAutoFocusOnce) {
self.lastAutoFocusOnceTime = now;
CardIOLog(@"Auto-triggered focusing");
[self autofocusOnce];
[self performSelector:@selector(resumeContinuousAutofocusing) withObject:nil afterDelay:0.1f];
didAutoFocus = YES;
// }
// }

Removed the condition for triggering autoFocusOnce method while capturing a picture, however I am not able to get a clear shot every time. The library captures an image before it recognizes the corners.
Kindly put me in the right direction to resolve this.
I am looking forward to get the same behavior as it is for payment cards.

4701fd0c-e50f-11e4-8268-5be5b52c9e35

@dgoldman-pdx
Copy link
Member Author

The library captures an image before it recognizes the corners.

@biksappdev Interesting. How can you tell that this is happening?

@biksappdev
Copy link

@dgoldman-ebay, The card is being captured almost immediately it is brought before the camera..it doesn;t wait to recognize the corners (as in the above picture).

@biksappdev
Copy link

Thats exactly what I am trying to resolve here.

@dgoldman-pdx
Copy link
Member Author

@biksappdev can you try experimenting with a card that is entirely a single color near its edges?

For your card above, the boundary between the interior white section of the card and the lower green boundary is probably triggering card.io's edge detector, and so it thinks that it has indeed located all four edges of the card.

(card.io looks for the four card edges, not the corners.)

@dgoldman-pdx
Copy link
Member Author

See also #22. Maybe you two can work on this together?

@vendeesh
Copy link

Hi Guys,
I need your help,
I used card.io library for scan credit/debit cards, its working fine. but i could not captured non-payment cards like iTunes, Dirving license cards in iOS. Where should i change/adjust the code. @dgoldman-ebay @biksappdev

@josharian
Copy link
Member

@vendeesh if you want to scan non-credit-cards with card.io, you can't right now. It's just for credit cards. Adding support for other kinds of cards is non-trivial.

card.io will, however, let you find any kind of card and grab an image of it. To do that, please start by looking at the public header files and at least trying to figure this out yourself. @dgoldman-ebay and I have limited bandwidth; the more precise a question you can ask, the better answer you will get.

@vendeesh
Copy link

Thanks Guys. i will try to do that, and let me inform.

@biksappdev
Copy link

@vendeesh, Did you figure out the right way to get clear and focussed images for non-payment cards using Card IO ?

@biksappdev
Copy link

@dgoldman-ebay , do you have any bandwidth to assist me in working on this issue ? I am still trying to find a nice clean way to get better focussed images for non-payment cards using Card IO.
Any help is greatly appreciated.

@josharian
Copy link
Member

@biksappdev did you try finding the place in the code where the focus score is calculated and used? That'd be a natural place to start experimenting.

@biksappdev
Copy link

@josharian , I would do that, another question that I would have to ask,
Is there any way to add a manual image capture button on the Card IO view( probably to this : @Property(nonatomic, retain, readwrite) UIView *scanOverlayView;) ? So instead of automatic card capturing, one can snap an image when the edges are focused.
Appreciate the help.

@josharian
Copy link
Member

Yes, that is possible, although I don't think it will be a good user experience. It's definitely not something we will add to the main repo.

To be perfectly honest, given your needs and inclinations, I'm not sure that using card.io makes that much sense. You might be better off just asking the user to take a photo and then implementing something yourself using the same overall approach as card.io (canny, hough, etc.). You're more than welcome to take any code you like from the card.io code base and adapt it to your needs, without consuming card.io wholesale, for the low low price of an acknowledgment.

In any case, card.io is intentionally focused on a single use case, and the further your needs diverge from that use case: (1) the lower the probability any changes could be contributed back, (2) the less investment the card.io maintainers will make in your desired code changes, (3) the less helpful card.io as it stands will be for you, and (4) the more card.io will be dead weight and binary bloat.

@biksappdev
Copy link

@josharian , I am not facing any issues with Payment cards scanning, its just focussing issues while scanning other cards ( like Gift Cards, DL, Shopping cards etc.). So only need to find a way to adjust the focus better and be able to detect the edges cleanly just like it does for payment cards.

@ashugit
Copy link

ashugit commented Jul 30, 2015

@josharian I am also looking to use card.io for more than one reason, 1. to scan a payment card and another to use it get edge detection on Government ID cards.
I have some code that uses (Canny and HoughlinesP) currently built to run at Rails server and might need MUCH more optimization to faithfully work on most cases. I was trying to build it as a static image scan but our requirement might take a turn to run it on previews and I want to use card.io if possible.
Is it possible to find the code that can help me with edge detection atleast. I don't know if full code is available to peek into or not. I am fairly new to look at card.io SDK.

@burnto
Copy link
Member

burnto commented Jul 30, 2015

The card edge detection and image capture (your second use case) is already
an option actually. See the detectionMode property on
CardIOViewController.
On Thu, Jul 30, 2015 at 4:47 AM Sudhanshu Saxena notifications@github.com
wrote:

@josharian https://github.com/josharian I am also looking to use card.io
for more than one reason, 1. to scan a payment card and another to use it
get edge detection on Government ID cards.
I have some code that uses (Canny and HoughlinesP) currently built to run
at Rails server and might need MUCH more optimization to faithfully work on
most cases. I was trying to build it as a static image scan but our
requirement might take a turn to run it on previews and I want to use
card.io if possible.
Is it possible to find the code that can help me with edge detection
atleast. I don't know if full code is available to peek into or not. I am
fairly new to look at card.io SDK.


Reply to this email directly or view it on GitHub
#21 (comment)
.

@ashugit
Copy link

ashugit commented Jul 31, 2015

@burnto Thanks a lot, I will start with that. I guess it should work because edge detection I saw is independent of card details. I will update here if I get it working. Thanks again.

@ashugit
Copy link

ashugit commented Aug 5, 2015

@burnto I see one issue which I believe is also related to focus, when I try to run my feature detector camera captured image it works way better with tesseract OCR.

@coooliang
Copy link

@biksappdev I have same question, do you resolve the question?!~

@yangmiok
Copy link

Is there anyone can use the card.io library for scan Non-payment cards?

@jagtu
Copy link

jagtu commented Feb 21, 2017

@mengmanzbh 你实现了使用card.io library 识别储蓄卡没?求指教

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants