function onRecognitionFn(recognized, response) {
        if (recognized) {
            /* Clean Resources from previous recognitions. */
            if (World.wineLabel !== undefined) {
                World.wineLabel.destroy();
            }

            if (World.wineLabelOverlay !== undefined) {
                World.wineLabelOverlay.destroy();
            }

            /*
                To display the label of the recognized wine on top of the previously created banner, another
                overlay is defined. From the response object returned from the server the 'targetInfo.name' property
                is read to load the equally named image file. The zOrder property (defaults to 0) is set to 1 to
                 make sure it will be positioned on top of the banner.
            */
            World.wineLabel = new AR.ImageResource("assets/" + response.targetInfo.name + ".jpg", {
                onError: World.onError
            });
            World.wineLabelOverlay = new AR.ImageDrawable(World.wineLabel, 0.27, {
                translate: {
                    x: -0.5,
                    y: -0.6
                },
                zOrder: 1
            });

            if (World.wineLabelAugmentation !== undefined) {
                World.wineLabelAugmentation.destroy();
            }

            /*
                The following combines everything by creating an AR.ImageResource using the CloudRecognitionService,
                the name of the image target and the drawables that should augment the recognized image.
            */
            World.wineLabelAugmentation = new AR.ImageTrackable(World.tracker, response.targetInfo.name, {
                drawables: {
                    cam: [World.bannerImgOverlay, World.wineLabelOverlay]
                },
                onError: World.onError
            });

            World.hideInfoBar();
        }
    }
/*
        The onRecognition callback function defines two parameters. The first parameter is a boolean value which
        indicates if the server was able to detect the target, its value will be 0 or 1 depending on the outcome.
        The second parameter a JSON Object will contain metadata about the recognized target, if no target was
        recognized the JSON object will be empty.
    */
The onRecognition callback function defines two parameters. The first parameter is a boolean value which
indicates if the server was able to detect the target, its value will be 0 or 1 depending on the outcome.
The second parameter a JSON Object will contain metadata about the recognized target, if no target was
recognized the JSON object will be empty.
The onRecognition callback function defines two parameters . The first parameter is a boolean value which indicates if the server was able to detect the target its value will be 0 or 1 depending on the outcome . The second parameter a JSON Object will contain metadata about the recognized target if no target was recognized the JSON object will be empty .
function onRecognitionFn(recognized, response) {
        if (recognized) {
            if (World.wineLabel !== undefined) {
                World.wineLabel.destroy();
            }
            if (World.wineLabelOverlay !== undefined) {
                World.wineLabelOverlay.destroy();
            }
            World.wineLabel = new AR.ImageResource("assets/" + response.targetInfo.name + ".jpg", {
                onError: World.onError
            });
            World.wineLabelOverlay = new AR.ImageDrawable(World.wineLabel, 0.27, {
                translate: {
                    x: -0.5,
                    y: -0.6
                },
                zOrder: 1
            });
            if (World.wineLabelAugmentation !== undefined) {
                World.wineLabelAugmentation.destroy();
            }
            World.wineLabelAugmentation = new AR.ImageTrackable(World.tracker, response.targetInfo.name, {
                drawables: {
                    cam: [World.bannerImgOverlay, World.wineLabelOverlay]
                },
                onError: World.onError
            });
            World.hideInfoBar();
        }
    }
function onRecognitionFn ( recognized , response ) { if ( recognized ) { if ( World . wineLabel !== undefined ) { World . wineLabel . destroy ( ) ; } if ( World . wineLabelOverlay !== undefined ) { World . wineLabelOverlay . destroy ( ) ; } World . wineLabel = new AR . ImageResource ( "assets/" + response . targetInfo . name + ".jpg" , { onError : World . onError } ) ; World . wineLabelOverlay = new AR . ImageDrawable ( World . wineLabel , 0.27 , { translate : { x : - 0.5 , y : - 0.6 } , zOrder : 1 } ) ; if ( World . wineLabelAugmentation !== undefined ) { World . wineLabelAugmentation . destroy ( ) ; } World . wineLabelAugmentation = new AR . ImageTrackable ( World . tracker , response . targetInfo . name , { drawables : { cam : [ World . bannerImgOverlay , World . wineLabelOverlay ] } , onError : World . onError } ) ; World . hideInfoBar ( ) ; } }
The onRecognition callback function defines two parameters.
The onRecognition callback function defines two parameters .
/* Clean Resources from previous recognitions. */ /*
                To display the label of the recognized wine on top of the previously created banner, another
                overlay is defined. From the response object returned from the server the 'targetInfo.name' property
                is read to load the equally named image file. The zOrder property (defaults to 0) is set to 1 to
                 make sure it will be positioned on top of the banner.
            */ /*
                The following combines everything by creating an AR.ImageResource using the CloudRecognitionService,
                the name of the image target and the drawables that should augment the recognized image.
            */