-
Notifications
You must be signed in to change notification settings - Fork 3
Read QR bar codes
aumentia edited this page Jan 25, 2015
·
1 revision
This library is capable also to read QR and bar codes. The supported standards are:
-
UPC-A
-
UPC-E
-
EAN-8
-
EAN-13
-
Code 39
-
Code 93
-
Code 128
-
ITF
-
Codabar
-
RSS-14 (all variants)
-
QR Code
-
Data Matrix
-
Aztec (‘beta’ quality)
-
PDF 417 (‘alpha’ quality)
In order to enable this feature, set search_mode to search_QRcodes or search_all
You can also read multiple QR / bar codes a time. To do that you will need to define ROIs, regions of interest, where to “look for” readable codes.
- (void)addQRRois
{
// Add regions to match several QR / bar codes
Roi *ROI1 = [[Roi alloc] initWithRect:CGRectMake(0, 0, 160, 240)];
Roi *ROI2 = [[Roi alloc] initWithRect:CGRectMake(0, 240, 160, 240)];
Roi *ROI3 = [[Roi alloc] initWithRect:CGRectMake(160, 0, 160, 240)];
Roi *ROI4 = [[Roi alloc] initWithRect:CGRectMake(160, 240, 160, 240)];
// Add them to the system
[_myVs addQRRect:ROI1];
[_myVs addQRRect:ROI2];
[_myVs addQRRect:ROI3];
[_myVs addQRRect:ROI4];
}
When a single or multiple QR / bar code is/are read, the QRMatchedProtocol protocol will give you the value/s:
- (void)singleQRMatchedResult:(NSString *)res
{
if ( ![res isEqualToString:@""])
{
VSLog(@"QR / bar code detected --> %@", res);
}
}
- (void)multipleQRMatchedResult:(NSArray *)codes
{
NSString *code = @"";
for (int i = 0; i < [codes count]; i++)
{
Roi *roi = [codes objectAtIndex:i];
code = 1;
}
VSLog(@"Multiple QR / bar codes detected --> %@", code);
}