welcome to linkAR technical documentation

next previous

Match Result

The library results are returned through two protocols, first one for matching images:

@protocol matcherProtocol <NSObject>
 
/**
 *  Optional callback: Called when an Image in the images pool is matched.
 *  @param uId: The matched image's unique ID
 */
-(void)imageRecognitionResult:(int)uId;
 
@end

There is a second one for matching QR codes:

@protocol matcherQRProtocol <NSObject>
 
@optional
 
/**
 *  Optional callback: Called when a QR or BAR code found
 *  @param code: The string of the code
 */
-(void)singleQRrecognitionResult:(NSString*)code;
 
/**
 *  Optional callback: Called when a more than one QR or BAR codes found
 *  @param codes: Array of ROIs found each ROI has the CGRect defining the crop rectangle and the QR string representation
 */
-(void)multipleQRrecognitionResult:(NSArray*)codes;
 
@end

4.1.- Implementation of image matching Callback

This callback is used to recieve image recognition results. It receives an id of the image that was successfully matched or -1 otherwise:

-(void)imageRecognitionResult:(int)uId
{
   NSLog(@"image id: %d", uId);
}

4.1.- Implementation of QR/BarCode recognition Callback

This callback is used to send the recognized QR codes and BarCode codes. It gives a string of matched code.

-(void)singleQRrecognitionResult:(NSString *)code
{
    NSLog(@"%@",code); 
}
 
-(void)multipleQRrecognitionResult:(NSArray*)codes
{
    NSString *code = @"";
    for (int i = 0; i < [codes count]; i++) {
        Roi *roi = [codes objectAtIndex:i];
        code = [code stringByAppendingString:roi.qrString];
        NSLog(@"*** QR multiple info *** %@ \n", [codes objectAtIndex:i]);
    }
}


Note: When you run the sample check out in the terminal the matched results
next previous