Start a new topic

Image Recognition IOS Ipad

Image Recognition IOS Ipad
1 Comment


Hello again, I've made ??some progress with the application for recognition of pictures but I have a problem when recognizing the image, the app runs fine but it seems that the files in the world are not loaded because it does not show that it is recognizing image or anything . 

 

Attached is a piece of code

 

Archive .js for recognition:

 


var World = {

loaded: false,

    

init: function initFn() {

     AR.context.services.sensors = false;

    this.createOverlays();

},

    

createOverlays: function createOverlaysFn() {

    this.tracker = new AR.Tracker("assets/marcas.wtc", {

                                  onLoaded: this.worldLoaded,

                                  onError: function(){

                                  console.log("error cargando el tracker");

                                  }

                                  });

    

    // Create overlay for page one

    var imgOne = new AR.ImageResource("assets/imageOne.png");

    var overlayOne = new AR.ImageDrawable(imgOne, 1, {

                                          offsetX: -0.15,

                                          offsetY: 0

                                          });

    

    // Make sure to change also the targetName (pageOne) to match the targetName of your image

    var pageOne = new AR.Trackable2DObject(this.tracker, "marcalogoutpl", {

                                           drawables: {

                                           cam: overlayOne

                                           }

                                           });

},

    

worldLoaded: function worldLoadedFn() {

    var cssDivLeft = " style='display: table-cell;vertical-align: middle; text-align: right; width: 50%; padding-right: 15px;'";

    var cssDivRight1 = " style='display: table-cell;vertical-align: middle; text-align: left; padding-right: 15px; width: 38px'";

    document.getElementById('loadingMessage').innerHTML =

    "<div" + cssDivLeft + ">Scan marca &#35;1 (utpl):</div>" +

    "<div" + cssDivRight1 + "><img src='assets/marcalogoutpl.png'></img></div>";

     

    setTimeout(function() {var e =document.getElementById('loadingMessage'); e.parentElement.removeChild(e);}, 15000);

}

};

 

World.init();

 

Archive ViewController.m:

 

#import "ViewController.h"

#import <WikitudeSDK/WTArchitectView.h>

 

@interface ViewController ()

@property (nonatomic, strong) WTArchitectView               *architectView;

@end

 

@implementation ViewController

 

- (void)viewDidLoad

{

    ;

    self.architectView = ;

    ;

    ;

    ;

}

 

- (void)didReceiveMemoryWarning

{

    ;

   

}

 

- (void)viewWillAppear:(BOOL)animated

{

    ;

    

    

    ;

}

 

- (void)startAR

{

    if ( !self.architectView.isRunning ) {

        ;

    }

}

 

 

- (void)stopAR

{

    if ( self.architectView.isRunning ) {

        ;

    }

}

 

- (BOOL)shouldAutorotate

{

    return YES;

}

 

- (NSUInteger)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskAll;

}

 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

    return YES;

}

 

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

{

    ;

}

 

@end

 

My file directory:

 



 

Regards.
Login or Signup to post a comment