welcome to linkAR technical documentation

next previous

Initiating ARMatcher:

In ViewController.h we have:

#define API_KEY @"33UIqVTjawzALYJqP/nhApazE8xonJgE7QhpnyDUfw=="
#import <UIKit/UIKit.h>
#import <CVSDK/ImageMatcher.h>
@interface ViewController : UIViewController <matcherProtocol>
    ImageMatcher* _cvView;

The API_KEY is only valid for the sample package: com.arlab.boxOfficeMatcher.

In the ViewController.m we have:

- (void)viewDidLoad
    //1.- Create an instance of the ImageMatcher object.
    _cvView = [[ImageMatcher alloc] initWithAppKey:API_KEY useDefaultCamera:YES];
    [_cvView setMatcherDelegate:self];
    //2.- Set the type of the matching.
    [_cvView setMatchMode:matcher_mode_Image];
    //3.- Enable median filter, witch help to reduce noise and mismatches in IMAGE matching. (Optional)
    [_cvView setEnableMedianFilter:YES];
    //4.- Set minimum image quality threshold ,for image to be accepted to the image pool.
    [_cvView setImagePoolMinimumRating:10];
    //5.- Set the frame of the ImageMatcher instance.
    [_cvView.view setFrame:_matchView.frame];
    //6.- Add camera view instance to the matcher view.
    [_matchView addSubview:_cvView.view];
    [_matchView sendSubviewToBack:_cvView.view];

1-Initiates the Matcher.
2-As we do not want QR recognition, we set only Image Matcher.
3-In this case, we use the default camera, then the median filter is recommended.
4-We would like to accept only very good images, so we set the image quality to its best.
5-We indicate the exact width and height that we want fo our macher view.
6-We add the camera view instance to the view.

The functions “start” and “stop” of the library are crucial:

    [_cvView start];
-(void) viewWillDisappear:(BOOL)animated{
    [_cvView stop];

next previous