Which method is called when image is recognized in WTArchitect in ios?
Please reply me , actually i want to call a maethod only when image is recognized.? So i want to know which method is call when recognized
A
Andreas Schacherbauer
said
about 11 years ago
Hi,
the iOS SDK doesn't has a designated mehtod which is called if a tracker in your ARchitectWorld found a image target. What you can do to acomplish this is, that you can call 'document.location = architectsdk://TrackerDidDiscoveredImageTarget?id=<aImageTargetID>' in your onEnterFieldOfVisionTrigger of the Trackable2DObject. Then you can set the delegate of your WTArchitectView instance to a object which is conform to the WTArchitectViewDelegate protocol and which implements the -urlWasInvoked: method. Inside urlWasInvoked, you can check if the passed url is equal to the url which you passed as your document.location. If you have multiple image targets, you can check the id which you can pass as an paramter of the url. After that, you can call any method in ObjC that you want to.
Best regards
Andreas
r
rahul soni
said
about 11 years ago
Thanks Sir,
I have another problem that as in IR ImageRecognization, when image is recognized so an overlay of architect image is show and four arrows is shown, So can i call a javascript method on click of that overlay image when image is recognized.
Is this is possible then please tell me how to set architect overlay's click event and its calling a javascript method on its click..
A
Andreas Schacherbauer
said
about 11 years ago
Hi,
the overlay is an AR.ImageDrawable. According to the specification, you can add a onClick trigger function which is called each time you tap on the overlay.
As you can see in the SimpleIRWorld, there is the variable overaly:
var overlay = new AR.ImageDrawable(image, 1.0, {zOrder: 0});
You can define a onClick trigger like that:
overlay.onClick = function(){
alert('click on drawable');
// you can call any other JS function here
};
Best regards
Andreas
r
rahul soni
said
about 11 years ago
Thanks a lot Sir Andreas ,
My problem is solved , because you help me.
I used onEnterFieldOfVision this for calling method after image is recognized.
Thanks.
r
rahul soni
said
about 11 years ago
Hello Sir,
My last one problem , How to set a unique id of recognized image , i have set two images in traceble and its properly recognized, but i want to set unique id to each image, please say me how can i do this because on basis of this id i want to open different pages in objective c?
Tell me what to edit in this to set id or how to set id=<aImageTargetID> in document.location = "architectsdk://TrackerDidDiscoveredImageTarget?id=<aImageTargetID>;... , so how to know aImageTargetID ?
Sir, Now i want to make an array of trackable2DObject and keep images reference in that array in it, so how to create trackable2DObject's Array and i want to reterieve images name and project name from webserver, because i want to track multiple images which is in my webserver.
1) I want to send multiple images in traceproject which would be ready for tracing from qualcom,Flow which i want is --> my all webserver images is 1st go to qualCom at a time and then ready to trace, then I download that traceble project.So, How to send all images at a time to qualcom and my all images become ready for tracing? please suggest me this first Sir?
2) Then if this happens successfully,i want to keep this traceble project in my database, and then reterieve images and project name from databse and send it to trackable2DObject's Array which is in my HTML file, this is the flow i want , How to achieve this Suggest me Sir.
is it possible to pass name of images and projectname in which this images lies to our .html file, how can i acheieve this please guide me or if you have any demo code so please provide
A
Andreas Schacherbauer
said
about 11 years ago
Hi,
1)
I'm not aware if this is possible, please check with qualcomm if you can create a dataset which contains multiple image targets with a qualcomm api.
2)
Since an architectworld is just like a regular html page, use javascript to access your webservice that will give you the names and image target urls that you need for creating the trackable2dobjects in javascript.
3)
Have a look at xmlhttprequest to connect to a webservice. Additionally libraries like jquery simplifies this.
Best regards
Andreas
r
rahul soni
said
about 11 years ago
Thanks Andreas sir
Now i have another problem that my application beomes crashes agter 3-4 successful recognization of images, i think its because of not releasing object array of trackable2d Object's array and Architect object, i am not releasing Architect object because i am using ARC concept ,
So tell me how to release trackable2dObjects array which is in my .html file? and is it necessary to release ARchitect object, so my application will not be crashes?
help me.
r
rahul soni
said
about 11 years ago
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.
rahul soni