Log in or register to post comments

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 1:30am #1

 

Hi!

I just want to know can you plz provide procedure how  to integrate cloud recognition in our iphone app!

I integrate it in my app but i am unable to handle its event properly it gives me many issue after recognizing the image(e.g. thread cant stop camera doesn't stop)

I called presentmodal view: ARParentViewController from my view for image recognition!

it reconize image only once then continous thread is running & app crash or camera can't goes in scanning mode again!

 

please provide us proper documentation for iphone as you provide it  for android!

 

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 3:55am #8

Hope you got my problem!

Not really.

I think you have made it very difficult for yourself by trying to change the sample without understanding the existing sample and thinking through the best approach.  I appreciate this is not easy, so it can take some time.

If all you want to do is to display your own books then all you need is a server that can return the JSON as the Vuforia sample does:

{"title":"Cloud Recognition in Vuforia","author":"Karina Borland","average rating":"4","# of ratings":"41","list price":"43.99","your price":"43.15","targetid":"a47d2ea6b762459bb0aed1ae9dbbe405","thumburl":"https://developer.vuforia.com/samples/cloudreco/thumbs/01_thumbnail.png","bookurl":"https://developer.vuforia.com/samples/cloudreco/book1.php"}

...while modifying the JSON accordingly.  Initially you probably don't need a sever as you may be able to change the code so that it returns the JSON locally without going to a server.

So my suggestion would be to start with the sample and see how you can modify it to get what you want.  The other advantage here is that it will help you to understand the code piece by piece before you try something more ambitious.

 

HTH

N

 

 

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 3:34am #7

Hi!

is the first part the same i.e. does the panel show up containing the book details that have been parsed via JSON?

ans: NO,but instead of book detail i got some id json string value using that i called my own view controller means i go into my Viewcontroller.

 

The "process" should be finished after the panel appears (scanning mode stops) and when the user presses X in the top right (scanning mode resumes)

--> Yes i know this but problem is exactly here panel not appear in my case instead of my own product response screen view controller appear!

..because i called my response on  condition book name not found in your app?

 

---> means in your sample code json string u got is  bookname which is concatinated with one url & it opens in web view & is got here

if (theBook)
    {
        trackingTextureAvailable = NO;
        [[ImagesManager sharedInstance] imageForBook:theBook
                                        withDelegate:self];
     
    }

so i dont have bookname in my database so it cannot goes in imagemanager class from where that panel is called & X this sign comes up!

so i m going in else condition & call my own viewcontroller! as that panel not comes up scanning mode not stop & also i m unable to resume scanning mode!

Hope you got my problem!

following is the condition code snippet which i explain you :-

this code is in EAGLView.mm file

-(void)infoRequestDidFinishForBook:(Book *)theBook withTrackableID:(const char*)trackable byCancelling:(BOOL)cancelled
{
    if (theBook)
    {
        trackingTextureAvailable = NO;
        [[ImagesManager sharedInstance] imageForBook:theBook       //here is one url/bookname which shows that panel X
                                        withDelegate:self];

     
    }
    else
    {
       
         PID=jsonFilename              //here i call my own viewcontroller product response
        
       NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setValue:PID forKey:DEFAULTS_RECEIVED_PID];                    
        [defaults synchronize];
        [NetworkHandler createNetworkRequestForProduct:@"LYKE"];
//this gives me my product response
      // [[NSNotificationCenter defaultCenter] postNotificationName:@"kBookWebDetailDismissed" object:nil];
        //[[NSNotificationCenter defaultCenter] postNotificationName:@"kStopLoading" object:nil userInfo:nil];
      
          [QCARHelper stopDetection];
               // [self dismissModalViewControllerAnimated:YES];
       // ProductResponseViewController *prv=[[ProductResponseViewController alloc]initWithNibName:@"ProdctResponseViewController" bundle:nil];
        
       // [self presentFramebuffer];
        
        if (NO == cancelled)
        {
            //  The trackable exists but it doesn't exist in our book database, so
            //  we'll mark that UniqueTargetId as a bad target
            [[BooksManager sharedInstance] addBadTargetId:trackable];
        }
        
        //  If theBook is nil, the loading UI would be shown forever and it
        //  won't scan again.  Send a notification to revert that state
        //[[NSNotificationCenter defaultCenter] postNotificationName:@"kStopLoading" object:nil userInfo:nil];
        ///[QCARHelper stopDetection];
    }
}
 

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 3:17am #6

Is the first part the same i.e. does the panel show up containing the book details that have been parsed via JSON?

bookWebDetailViewController does not complete any cycle as it has not to do with CloudReco - it is simply a modal dialog.  In the sample if the user does not touch the 3d panel it does not appear, and the sample does not break.

Now i have exact problem is how to stop or finish the process in my response

The "process" should be finished after the panel appears (scanning mode stops) and when the user presses X in the top right (scanning mode resumes)

...because i called my response on  condition book name not found in your app?

I do not know what you mean here.

 

N

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 2:42am #5

Hi!

1 - Does the cloud reco sample run

ans: Yes ,its run absolutely fine!

2 - Have you tried extending it with your own database to get the effect that you want

ans: Yes ,its give me respons for my own database!

 

3 - How is your application different to the CloudReco sample?

 

ans: Instead of showing Book web view(as shown in sample app) i shown my own product response screen  so i didnt go to in that class where your cycle is completed in bookwebviewController  &

Now i have exact problem is how to stop or finish the process in my response because i called my response on  condition book name not found in your app?

waiting for reply!

Thanx for reply!!

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 2:26am #4

It's almost impossible to debug your code in this instance, so I think you need to take a step back.

1 - Does the cloud reco sample run

2 - Have you tried extending it with your own database to get the effect that you want

3 - How is your application different to the CloudReco sample?

 

If you can answer (3) then you are half way there, because chances are that something is missing or in the wrong order, and really only you can find out what that is....

 

N

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 2:04am #3

Hi!

I know it is too much for u to read but if possible try to help me out!!

what i do it due to library path & header file issue i integrate my code in sample code i.e cloud recognition& in cloudrecoappdelegate.m i called my view of app

i got response for my image when i scan it  but i am unable to complete the cycle of image recognition!

means once i scan the image & again go for same image it doesn't give response(not gng in scan mode)but if i scan diff image it shows response screen.

& i am going in scanning mode by doing this from my view Controller

CGRect screenBounds = [[UIScreen mainScreen] bounds];
    window = [[UIWindow alloc] initWithFrame: screenBounds];
    ARParentViewController *ARPVCObj = [[ARParentViewController alloc] initWithWindow:window];
    [self.navigationController pushViewController:ARPVCObj animated:YES];

& what i do  in EAGLView.mm file

-(void)infoRequestDidFinishForBook:(Book *)theBook withTrackableID:(const char*)trackable byCancelling:(BOOL)cancelled
{
    if (theBook)
    {
        trackingTextureAvailable = NO;
        [[ImagesManager sharedInstance] imageForBook:theBook
                                        withDelegate:self];
     
    }
    else
    {
       
         PID=jsonFilename
        
       NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setValue:PID forKey:DEFAULTS_RECEIVED_PID];
        [defaults synchronize];
        [NetworkHandler createNetworkRequestForProduct:@"LYKE"];
//this gives me my product response
      // [[NSNotificationCenter defaultCenter] postNotificationName:@"kBookWebDetailDismissed" object:nil];
        //[[NSNotificationCenter defaultCenter] postNotificationName:@"kStopLoading" object:nil userInfo:nil];
      
          [QCARHelper stopDetection];
               // [self dismissModalViewControllerAnimated:YES];
       // ProductResponseViewController *prv=[[ProductResponseViewController alloc]initWithNibName:@"ProdctResponseViewController" bundle:nil];
        
       // [self presentFramebuffer];
        
        if (NO == cancelled)
        {
            //  The trackable exists but it doesn't exist in our book database, so
            //  we'll mark that UniqueTargetId as a bad target
            [[BooksManager sharedInstance] addBadTargetId:trackable];
        }
        
        //  If theBook is nil, the loading UI would be shown forever and it
        //  won't scan again.  Send a notification to revert that state
        //[[NSNotificationCenter defaultCenter] postNotificationName:@"kStopLoading" object:nil userInfo:nil];
        ///[QCARHelper stopDetection];
    }
}
 

 

also as i used tabbar so it gives folllowing error also

Unbalanced calls to begin/end appearance transitions for <MoreViewController: 0x6baba0>. error

 

following is the log in my app:-

2013-05-29 14:20:01.825 CloudReco[6802:907] * * ** * **  __managedObjectContext <NSManagedObjectContext: 0x6b46b0>
2013-05-29 14:20:08.785 CloudReco[6802:907] Unbalanced calls to begin/end appearance transitions for <MoreViewController: 0x6baba0>.
2013-05-29 14:20:09.868 CloudReco[6802:907] ARParentVC: creating
2013-05-29 14:20:09.958 CloudReco[6802:907] ARVC: loadView
2013-05-29 14:20:10.123 CloudReco[6802:907] QCAR OpenGL flag: 2
2013-05-29 14:20:10.129 CloudReco[6802:907] ARVC: viewDidLoad
2013-05-29 14:20:10.215 CloudReco[6802:907] QCARutils onCreate()
2013-05-29 14:20:10.221 CloudReco[6802:907] APPSTATUS_INIT_APP
2013-05-29 14:20:10.225 CloudReco[6802:907] APPSTATUS_INIT_QCAR
2013-05-29 14:20:10.232 CloudReco[6802:907] ARParentVC: loading
2013-05-29 14:20:10.242 CloudReco[6802:907] ARVC: Rotating to Portrait
2013-05-29 14:20:10.289 CloudReco[6802:907] ARParentVC: appearing
2013-05-29 14:20:10.296 CloudReco[6802:907] ARVC: Rotating to Portrait
2013-05-29 14:20:10.320 CloudReco[6802:907] ARVC: viewWillAppear
2013-05-29 14:20:10.340 CloudReco[6802:5603] INFO/AR(6802) 2013-05-29 14:20:10: QCAR SDK version 2.0.32
2013-05-29 14:20:10.334 CloudReco[6802:907] EAGLView: layoutSubviews
2013-05-29 14:20:10.382 CloudReco[6802:907] #DEBUG setRenderState 0 --> 0
2013-05-29 14:20:10.585 CloudReco[6802:907] APPSTATUS_INIT_TRACKER
2013-05-29 14:20:10.634 CloudReco[6802:907] Successfully initialized ImageTracker.
2013-05-29 14:20:10.638 CloudReco[6802:907] APPSTATUS_INIT_APP_AR
2013-05-29 14:20:10.643 CloudReco[6802:907] APPSTATUS_LOAD_TRACKER
2013-05-29 14:20:10.650 CloudReco[6802:7503] Initialize Visual Search in background thread
2013-05-29 14:20:10.736 CloudReco[6802:907] ARParentVC: appeared
2013-05-29 14:20:10.738 CloudReco[6802:907] ARVC: viewDidAppear
2013-05-29 14:20:10.740 CloudReco[6802:907] QCARutils onResume()
2013-05-29 14:20:11.486 CloudReco[6802:907] APPSTATUS_INITED
2013-05-29 14:20:11.598 CloudReco[6802:907] DEBUG/AR(6802) UIView has CAEAGLLayer class
2013-05-29 14:20:11.600 CloudReco[6802:907] DEBUG/AR(6802) UIView responds to selector renderFrameQCAR
2013-05-29 14:20:11.616 CloudReco[6802:907] Video background get data 960 720
2013-05-29 14:20:11.620 CloudReco[6802:907] APPSTATUS_CAMERA_RUNNING
2013-05-29 14:20:11.636 CloudReco[6802:907] Video background get data 960 720
2013-05-29 14:20:13.685 CloudReco[6802:907] *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (
    Width,
    AVVideoScalingModeKey,
    Height
)
2013-05-29 14:20:16.092 CloudReco[6802:960f] INFO/AR(6802) 2013-05-29 14:20:16: Completed CloudReco transaction with ID 'd4137a4036674f039acba4a37e3952aa'
2013-05-29 14:20:16.388 CloudReco[6802:1613] INFO/AR(6802) 2013-05-29 14:20:16: ImageTracker: Successfully created dataset
2013-05-29 14:20:16.655 CloudReco[6802:1613] INFO/AR(6802) 2013-05-29 14:20:16: Successfully created ImageTarget.
2013-05-29 14:20:16.667 CloudReco[6802:1613] Successfully created new trackable 'Aashiqui2_1' with rating '3'.
2013-05-29 14:20:16.853 CloudReco[6802:7f07] metadataa={"cid": "5", "pid": "5", "version": "1.0.0"}

2013-05-29 14:20:16.857 CloudReco[6802:7f07] metadataa2=5
2013-05-29 14:20:17.039 CloudReco[6802:907] Server Response jsonString !: {"status":1,"title":"Aashiqui 2","brand":"Aashiqui 2","pictures":["http://cms.lykeback.com/Upload/ProductImages/400-x-300-aashiquei-5.jpg"],"cacheexpiry":"2013-05-29T23:59:59Z","touchpoints":[{"icon":"http://cms.lykeback.com/Upload/TouchPointIcons/arrow.png","text":"About Movie","url":"http://m.imdb.com/title/tt2203308/","action":"URL","actiondata":null},{"icon":"http://cms.lykeback.com/Upload/TouchPointIcons/blaze.png","text":"Watch videos","url":"http://m.youtube.com/#/results?search_query=Aashiqui+2+movie","action":"URL","actiondata":null},{"icon":"http://cms.lykeback.com/Upload/TouchPointIcons/Contact.png","text":"Visit Facebook page","url":"http://m.facebook.com/Aashiqui2","action":"URL","actiondata":null}]}
2013-05-29 14:20:17.129 CloudReco[6802:907] Date dateee: 20130529142017
2013-05-29 14:20:17.653 CloudReco[6802:907] ARParentVC: dissappeared
2013-05-29 14:20:17.656 CloudReco[6802:907] ARVC: viewDidDisappear
2013-05-29 14:20:17.658 CloudReco[6802:907] QCARutils onPause()
2013-05-29 14:20:17.659 CloudReco[6802:907] APPSTATUS_CAMERA_STOPPED
2013-05-29 14:20:18.071 CloudReco[6802:907] ARVC: viewDidDisappear
2013-05-29 14:20:21.874 CloudReco[6802:907] ARParentVC: appearing
2013-05-29 14:20:21.877 CloudReco[6802:907] ARVC: Rotating to Portrait
2013-05-29 14:20:21.879 CloudReco[6802:907] ARVC: viewWillAppear
2013-05-29 14:20:22.238 CloudReco[6802:907] ARParentVC: appeared
2013-05-29 14:20:22.241 CloudReco[6802:907] ARVC: viewDidAppear
2013-05-29 14:20:22.242 CloudReco[6802:907] QCARutils onResume()
2013-05-29 14:20:22.385 CloudReco[6802:907] APPSTATUS_CAMERA_RUNNING
2013-05-29 14:20:22.391 CloudReco[6802:907] DEBUG/AR(6802) UIView has CAEAGLLayer class
2013-05-29 14:20:22.392 CloudReco[6802:907] DEBUG/AR(6802) UIView responds to selector renderFrameQCAR
2013-05-29 14:20:22.403 CloudReco[6802:907] Video background get data 960 720
2013-05-29 14:20:24.809 CloudReco[6802:b90b] INFO/AR(6802) 2013-05-29 14:20:24: Completed CloudReco transaction with ID '2452fd77696a4633add3007d3c8ee0f7'
2013-05-29 14:20:25.962 CloudReco[6802:b83f] INFO/AR(6802) 2013-05-29 14:20:25: Completed CloudReco transaction with ID '6fc1407c843942d79a70bd148cab6674'
2013-05-29 14:20:37.220 CloudReco[6802:cbbf] INFO/AR(6802) 2013-05-29 14:20:37: Completed CloudReco transaction with ID '35c0cc61748341639eeb50a20ce51071'
2013-05-29 14:20:39.707 CloudReco[6802:be7b] INFO/AR(6802) 2013-05-29 14:20:39: Completed CloudReco transaction with ID 'a52486c570004c36b689988da23b07d8'
2013-05-29 14:20:42.734 CloudReco[6802:be03] INFO/AR(6802) 2013-05-29 14:20:42: Completed CloudReco transaction with ID '4e2b5446d6df481ca07d01b4e992ba16'
2013-05-29 14:20:47.712 CloudReco[6802:ba1f] INFO/AR(6802) 2013-05-29 14:20:47: Completed CloudReco transaction with ID 'd76b0caa9a984a41b82cce88820cddda'
2013-05-29 14:20:48.204 CloudReco[6802:907] ARParentVC: dissappeared
2013-05-29 14:20:48.208 CloudReco[6802:907] ARVC: viewDidDisappear
2013-05-29 14:20:48.212 CloudReco[6802:907] QCARutils onPause()
2013-05-29 14:20:48.217 CloudReco[6802:907] APPSTATUS_CAMERA_STOPPED
2013-05-29 14:20:48.541 CloudReco[6802:907] ARVC: viewDidDisappear
 

Cloud Reco Integration (from kyasmin1983)

May 29, 2013 - 1:36am #2

Hi kyasmin1983

Have you run the sample and does it work ok?

If you are trying to integrate it into your own app then this is much more complex, and if there is a problem it is because you must have missed something.

 

please provide us proper documentation for iphone as you provide it  for android!

Not sure what you mean here.  All the documentation is more or less identical.

Other developers have been able to integrate Cloud Reco without issue.  Please also check that forum and learn from the experiences of other developers.

Then if you have a technical issue and you can describe what you have done, the problems encountered, and any visible logs then maybe we can help you.

 

HTH

N

 

 

 

Log in or register to post comments