Start a new topic

Application Crashes after 3-4 image recognization?

Application Crashes after 3-4 image recognization?


I am using ARchitect and trackable2dObject array, and i m recognizing multiple images through my code and images recognized correctly, but after 2-3 recognization application crashes, i think its because ot not releasing trackable2dObject and AR object, so how to release it? or there is any other reason for crashing?

 

Please suggest me how to release trackable2d  objects's array and Ar object?

trackable2DObjects.push , i push 3 images in it , it runs successfully in ipad but not in iphone? so please suggest me how to release this object in javascript? or any other issue?
 

IR mode, which uses more computing power (and battery power),  is started whenever you create a Tracker. Thus make sure to call destroy() on the Tracker if you don?t require the IR instance anymore. If all Trackers are destroyed, IR mode is exited automatically.

 

So where and how can i call this destroy function?

I using this code, , so no image tracking is done ? and its right also because we destroy this object? so where i call this function? please suggest me?    

  var trackObj1=new AR.Trackable2DObject(logoTracker, targetIds, { drawables: { cam: },onEnterFieldOfVision: generate (targetIds), onExitFieldOfVision:generate (targetIds)
                                              });
        
        trackable2DObjects.push(trackObj1);
        
        trackObj1.destroy();

 

I also used this code

var trackObj1=;
        
        trackable2DObjects.push(new AR.Trackable2DObject(logoTracker, targetIds, { drawables: { cam: },onEnterFieldOfVision: generate (targetIds), onExitFieldOfVision:generate (targetIds)
                                              }));
        
        trackable2DObjects.destroy();

 

Please reply me i am trying this from last 24hrs, if not destroy() so my app crashes and if use destroy so recognization not performing?


 

you will need to destroy the Tracker not the Trackable2dObject. e.g. logoTracker.destroy();

Thanks Wolfgang,

I trying your this code logoTracker.destroy(); in this method , but html not loading? please tell me where,

i put this of yours line? please suggest me?

 

function createTracker(){
    var image = new AR.ImageResource("target.png", {onError: error});
    overlay = new AR.ImageDrawable(image, 1.0, {zOrder: 0});
 
    
    // create tracker
    logoTracker = new AR.Tracker(trackerDataSetPath, { onLoaded : trackerLoaded, onError: error });
    

    // relative position from teh arrows
    arrowXOffset = 2.0;
    arrowYOffset = 0.1;

    var arrow1 = arrowWithDirectionality(-arrowXOffset, -arrowYOffset, -45);
    var arrow2 = arrowWithDirectionality(-arrowXOffset, arrowYOffset, 45);
    var arrow3 = arrowWithDirectionality(-arrowXOffset, -arrowYOffset, 135);
    var arrow4 = arrowWithDirectionality(-arrowXOffset, arrowYOffset, 225);

    for (var i = 0; i < targetIds.length; i++)
    {
        
        var trackObj1=new AR.Trackable2DObject(logoTracker, targetIds, { drawables: { cam: },onEnterFieldOfVision: generate (targetIds), onExitFieldOfVision:generate (targetIds)
                                              });
        
        trackable2DObjects.push(trackObj1);
        
        //trackObj1.destroy();
        
    }

   logoTracker.destroy();
   
    // we need to pack the arrow animations into a parallel animation group to play them synchronisly

    masterAnimationGroup = new AR.AnimationGroup(AR.CONST.ANIMATION_GROUP_TYPE.PARALLEL, );
}


 

 

please use ADE to investigate why the html is not loading. This should allows you to debug the javascript code.

Furthermore you will need to make a better decision when to destroy the tracker. Currently you are destorying it right after creating the trackable2dobjects. You must not destroy the tracker object while you want it to recognize any trackable2dobjects you created.

Thanks Wolfgang.Now, my all problem is solved.

Your team is really very supporting, great work.

Thanks for your support. :)
 
Login or Signup to post a comment