Log in or register to post comments

black screen after pushing view from my custom viewController to arParentViewController

March 4, 2013 - 2:04am #1

in your sample app of cloud reco, I add a rootview controller (StartViewController) connected to storyboard  , this view has a button  used to push the view  ( arParentViewController )

 

in CloudRecoAppDelegate, i remove everything and add below only

 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    CRQCARutils *qUtils = [CRQCARutils getInstance];

    qUtils.deviceOrientationLock = DeviceOrientationLockAuto;

    return YES;

}

 

in StartViewController

 

- (IBAction)Start:(id)sender {

    arParentViewController = [[CRParentViewController alloc] initWithNibName:nil bundle:nil];

    [self.navigationController pushViewController:arParentViewController animated:YES];

}

 

compile and run normally, but i press the button for pushing arParentViewController, it show black screen, the camera seems running and detecting well . but it fail to show the recognition result 

 

 

2013-03-04 17:50:17.175 CloudReco[15265:907] ARVC: loadView

2013-03-04 17:50:17.303 CloudReco[15265:907] QCAR OpenGL flag: 2

2013-03-04 17:50:17.308 CloudReco[15265:907] ARVC: viewDidLoad

2013-03-04 17:50:17.355 CloudReco[15265:907] QCARutils onCreate()

2013-03-04 17:50:17.357 CloudReco[15265:907] APPSTATUS_INIT_APP

2013-03-04 17:50:17.359 CloudReco[15265:907] APPSTATUS_INIT_QCAR

2013-03-04 17:50:17.370 CloudReco[15265:907] ARParentVC: loading

2013-03-04 17:50:17.372 CloudReco[15265:907] ARVC: Rotating to Landscape Right

2013-03-04 17:50:17.374 CloudReco[15265:907] ARParentVC: appearing

2013-03-04 17:50:17.376 CloudReco[15265:907] ARVC: Rotating to Landscape Right

2013-03-04 17:50:17.378 CloudReco[15265:907] ARVC: viewWillAppear

2013-03-04 17:50:17.439 CloudReco[15265:1a07] INFO/AR(15265) 2013-03-04 17:50:17: QCAR SDK version 2.0.30

2013-03-04 17:50:17.649 CloudReco[15265:907] APPSTATUS_INIT_TRACKER

2013-03-04 17:50:17.682 CloudReco[15265:907] Successfully initialized ImageTracker.

2013-03-04 17:50:17.683 CloudReco[15265:907] APPSTATUS_INIT_APP_AR

2013-03-04 17:50:17.684 CloudReco[15265:907] APPSTATUS_LOAD_TRACKER

2013-03-04 17:50:17.686 CloudReco[15265:1a0b] Initialize Visual Search in background thread

2013-03-04 17:50:17.809 CloudReco[15265:907] ARParentVC: appeared

2013-03-04 17:50:17.810 CloudReco[15265:907] ARVC: viewDidAppear

2013-03-04 17:50:17.811 CloudReco[15265:907] QCARutils onResume()

2013-03-04 17:50:18.369 CloudReco[15265:907] APPSTATUS_INITED

2013-03-04 17:50:18.495 CloudReco[15265:907] *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (

    Width,

    AVVideoScalingModeKey,

    Height

)

2013-03-04 17:50:18.502 CloudReco[15265:907] DEBUG/AR(15265) UIView has CAEAGLLayer class

2013-03-04 17:50:18.503 CloudReco[15265:907] DEBUG/AR(15265) UIView responds to selector renderFrameQCAR

2013-03-04 17:50:18.511 CloudReco[15265:907] ERROR/AR(15265) 2013-03-04 17:50:18: VideoBackgroundConfig with screen size of zero received, skipping config step

2013-03-04 17:50:18.512 CloudReco[15265:907] Video background get data 0 0

2013-03-04 17:50:18.513 CloudReco[15265:907] APPSTATUS_CAMERA_RUNNING

2013-03-04 17:50:18.522 CloudReco[15265:907] ERROR/AR(15265) 2013-03-04 17:50:18: VideoBackgroundConfig with screen size of zero received, skipping config step

2013-03-04 17:50:18.523 CloudReco[15265:907] Video background get data 0 0

2013-03-04 17:50:19.230 CloudReco[15265:907] Failed to make complete framebuffer object 8cd6

2013-03-04 17:50:19.234 CloudReco[15265:5f0b] ERROR/AR(15265) 2013-03-04 17:50:19: VideoBackgroundConfig with screen size of zero received, skipping config step

2013-03-04 17:50:19.236 CloudReco[15265:5f0b] Video background get data 0 0

2013-03-04 17:50:20.334 CloudReco[15265:752b] INFO/AR(15265) 2013-03-04 17:50:20: Completed CloudReco transaction with ID 'e898e221f313406c9a51cd4c027645de'

2013-03-04 17:50:28.398 CloudReco[15265:921f] INFO/AR(15265) 2013-03-04 17:50:28: Completed CloudReco transaction with ID '0978ed19115a4ad392bb8d5b28574bcb'

2013-03-04 17:50:30.499 CloudReco[15265:92e7] INFO/AR(15265) 2013-03-04 17:50:30: Completed CloudReco transaction with ID 'be5750e1515645c1b6c2eb87e6f7a23a'

2013-03-04 17:50:39.153 CloudReco[15265:418b] INFO/AR(15265) 2013-03-04 17:50:39: Completed CloudReco transaction with ID '56e7f8fbf06d48bb8c753ec62429d4c6'

2013-03-04 17:50:39.273 CloudReco[15265:941b] INFO/AR(15265) 2013-03-04 17:50:39: ImageTracker: Successfully created dataset

2013-03-04 17:50:39.313 CloudReco[15265:941b] INFO/AR(15265) 2013-03-04 17:50:39: Successfully created ImageTarget.

2013-03-04 17:50:39.317 CloudReco[15265:941b] ********** 27e2114a40894606ab746a12401356ab

2013-03-04 17:50:39.318 CloudReco[15265:941b] Successfully created new trackable 'polyuLibrary' with rating '1'.

2013-03-04 17:50:39.411 CloudReco[15265:5f0b] ********** 27e2114a40894606ab746a12401356ab

2013-03-04 17:50:39.412 CloudReco[15265:5f0b] polyuLibrary.json

2013-03-04 17:50:39.413 CloudReco[15265:5f0b] ########## http://myweb.polyu.edu.hk/~10519118d/ios/json/polyuLibrary.json

2013-03-04 17:50:39.451 CloudReco[15265:5f0b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'

*** First throw call stack:

(0x320872a3 0x39f2797f 0x31fd2b75 0xa785 0xae509 0xadfd5 0x3a37e311 0x3a37e1d8)

libc++abi.dylib: terminate called throwing an exception

(lldb) 

black screen after pushing view from my custom viewController t

November 15, 2013 - 1:53am #13

You need to understand the errors:

 Property 'arViewSize' cannot be found in forward class object 'CRParentViewController'

This means you have missed a step in my original instruction.  Look for this:

@property (nonatomicCGSize arViewSize;

 

HTH

N

black screen after pushing view from my custom viewController t

November 15, 2013 - 12:30am #12

Hi,

I'm following your tips but I have these errors:

 

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartAppDelegate.mm

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartAppDelegate.mm:53:12: Unused variable 'screenBounds'

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartViewController.m

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartViewController.m:33:31: Receiver 'CRParentViewController' is a forward class and corresponding @interface may not exist

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartViewController.m:36:27: Property 'arViewSize' cannot be found in forward class object 'CRParentViewController'

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartViewController.h:11:8: Forward declaration of class here

/Users/io/Documents/vuforia-sdk-ios-2-6-8/samples/CloudReco-2-6-6/Classes/CloudReco/StartViewController.m:47:51: Incompatible pointer types sending 'CRParentViewController *' to parameter of type 'UIViewController *'

 

I've used your code in particular StartAppDelegate.h it's here:

 

 

#import <UIKit/UIKit.h>

@class CRParentViewController;

 

 

@interface StartAppDelegate : UIResponder <UIApplicationDelegate>{

    UIWindow* window;

}

 

@end

 

 

And StartAppDelegate.mm it's here:

 

 

#import "StartAppDelegate.h"

#import "CRParentViewController.h"

#import "CRQCARutils.h"

#import "QCARHelper.h"

 

@implementation StartAppDelegate

@synthesize window = _window;

 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    // Create the CR-specific QCARutils object to replace the standard one and

    // set the device orientation lock to automatic mode

    CRQCARutils *qUtils = [CRQCARutils getInstance];

    qUtils.deviceOrientationLock = DeviceOrientationLockAuto;

    

    CGRect screenBounds = [[UIScreen mainScreen] bounds];

    //    _window = [[UIWindow alloc] initWithFrame: screenBounds];

    

    

    // Override point for customization after application launch - allows my collection view controller rather than the default

    return YES;

}

 

- (void)applicationWillResignActive:(UIApplication *)application

{

    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

}

 

- (void)applicationDidEnterBackground:(UIApplication *)application

{

    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}

 

- (void)applicationWillEnterForeground:(UIApplication *)application

{

    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

}

 

- (void)applicationDidBecomeActive:(UIApplication *)application

{

    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

}

 

- (void)applicationWillTerminate:(UIApplication *)application

{

    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

}

 

@end

Can someone help me?

Thanks in advance

Luca

 

black screen after pushing view from my custom viewController t

April 8, 2013 - 3:59am #11

Great to hear :)

N

black screen after pushing view from my custom viewController t

April 6, 2013 - 5:47am #10

Thanks, I've solved them

black screen after pushing view from my custom viewController t

March 28, 2013 - 3:50am #9

1 - Click on the project in the Project Navigator, then on the Target and then on Summary.  Scroll down and you should see "Supported Interface Orientations" - so just click on the ones you wish to support and lock out the others.  This should prevent the autorotation messages.  If this doesn't work, then check the Apple docs

2 - What you need to do is not create a new CRViewController each time.  Simply create it once (holding a reference to it) and then push that instance each time. This way it is faster, and the scan line should work.

 

HTH

N

black screen after pushing view from my custom viewController t

March 27, 2013 - 11:27pm #8

Thanks . I have rewrite it successfully.

two more questions 

question 1

how can it lock camera screen orientation into portait. 

if current screen orientation is portait, and it pass a self.view.frame.size into CRParentViewCtroller and push a CRParentViewCtroller, the screen work fine.

at this time, i rotate my ipad into landscape, the viewsize is wrong , a part of camera screen become black.

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
   // BOOL retVal = [[CRQCARutils getInstance] shouldAutorotateToInterfaceOrientation:toInterfaceOrientation];
    return NO;
}

 

i tried to set the return value to No, it still rotate the screen. 

can you suggest me how to block the camera screen into portait  ?

 

question 2

as i use storyboard to push a CRviewController.

i have a startViewController with a button. as long as i push that button. CRViewController view will be pushed. all thing work fine, (the scanning bar is moving well)

and then i press back button on the navigation bar and push back to view of StartViewController, after i tap the start button on the StartViewController and push CRViewController again, i found the scanning bar is disappeare, but image recongition is working well. 

how can i get back scanning bar when i push CRViewController from view of StartViewController again in this case?

black screen after pushing view from my custom viewController t

March 27, 2013 - 3:40am #7

It is difficult to know what to say.

The errors are meaningless to me.

 

I think the only thing you can do is to start again :(

Sometimes this happens, but it happens to everyone.

In future you will also make sure that you take a project backup.

 

N

black screen after pushing view from my custom viewController t

March 27, 2013 - 2:50am #6
Hi Nalis,

 

as i lost my use drive with my vuforia project,  and your suggesting code are work for my lost project, thanks again.

  but this time, i rewrite the code. this is still not work. I use your suggesting code and method. but still not working.

can you give me some suggestions!! 

i have printscreen the error in following picture.

http://myweb.polyu.edu.hk/~10519118d/error.png

 

 CompileC /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/Objects-normal/armv7/StartAppDelegate.o Classes/CloudReco/StartAppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

    cd /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7

    setenv LANG en_US.US-ASCII

    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -std=c99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -funroll-loops -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=6.1 -iquote /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/CloudReco-generated-files.hmap -I/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/CloudReco-own-target-headers.hmap -I/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/CloudReco-all-target-headers.hmap -iquote /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/CloudReco-project-headers.hmap -I/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Products/Debug-iphoneos/include -I../sdk/build/include -I/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/DerivedSources/armv7 -I/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/DerivedSources -F/Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Products/Debug-iphoneos -mfpu=neon -include /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/PrecompiledHeaders/CloudReco_Prefix-emhsgvposyzxyrcndarouttudtfm/CloudReco_Prefix.pch -MMD -MT dependencies -MF /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/Objects-normal/armv7/StartAppDelegate.d --serialize-diagnostics /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/Objects-normal/armv7/StartAppDelegate.dia -c /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/StartAppDelegate.m -o /Users/vincent/Library/Developer/Xcode/DerivedData/CloudReco-garmofjcmcfdvoejikhopqmxrkev/Build/Intermediates/CloudReco.build/Debug-iphoneos/CloudReco.build/Objects-normal/armv7/StartAppDelegate.o

 

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/StartAppDelegate.m:8:

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/CRQCARutils.h:8:

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:8:

In file included from ../sdk/build/include/QCAR/Tool.h:18:

../sdk/build/include/QCAR/Matrices.h:16:1: error: unknown type name 'namespace'

namespace QCAR

^

../sdk/build/include/QCAR/Matrices.h:16:15: error: expected ';' after top level declarator

namespace QCAR

              ^

              ;

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/StartAppDelegate.m:8:

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/CRQCARutils.h:8:

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:13:

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/Texture.h:19:1: error: unexpected '@' in program

@property (nonatomic, readonly) int height;

^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/Texture.h:20:1: error: unexpected '@' in program

@property (nonatomic) int textureID;

^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/Texture.h:21:1: error: unexpected '@' in program

@property (nonatomic, readonly) unsigned char* pngData;

^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/Texture.h:23:1: error: missing context for method declaration

- (BOOL)loadImage:(NSString*)filename;

^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/Texture.h:25:1: error: expected method body

@end

^

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/StartAppDelegate.m:8:

In file included from /Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/Classes/CloudReco/CRQCARutils.h:8:

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:20:3: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]

} TargetType;

  ^~~~~~~~~~

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:55:5: error: type name requires a specifier or qualifier

    QCAR::DataSet *dataSet;

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:55:10: error: expected expression

    QCAR::DataSet *dataSet;

         ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:60:23: error: type name requires a specifier or qualifier

@property (nonatomic) QCAR::DataSet *dataSet;

                      ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:60:28: error: expected expression

@property (nonatomic) QCAR::DataSet *dataSet;

                           ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:81:5: error: unknown type name 'TargetType'

    TargetType targetType;      // for app to inform QCARutils

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:90:5: error: type name requires a specifier or qualifier

    QCAR::Matrix44F projectionMatrix; // OpenGL projection matrix

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:90:10: error: expected expression

    QCAR::Matrix44F projectionMatrix; // OpenGL projection matrix

         ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:100:5: error: type name requires a specifier or qualifier

    QCAR::DataSet * currentDataSet; // the loaded DataSet

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:100:10: error: expected expression

    QCAR::DataSet * currentDataSet; // the loaded DataSet

         ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:100:5: error: duplicate member 'QCAR'

    QCAR::DataSet * currentDataSet; // the loaded DataSet

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:90:5: note: previous declaration is here

    QCAR::Matrix44F projectionMatrix; // OpenGL projection matrix

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:105:5: error: type name requires a specifier or qualifier

    QCAR::CameraDevice::CAMERA activeCamera;

    ^

/Users/vincent/Development/fyp/Experiment/vuforia/modified_version2.0/CloudReco-2-0-7/ARCommon/QCARutils.h:105:10: error: expected expression

    QCAR::CameraDevice::CAMERA activeCamera;

         ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

1 warning and 20 errors generated.

black screen after pushing view from my custom viewController t

March 26, 2013 - 1:45pm #5

After following this technique, I get a black screen before the camera shows the scanning of the image.  I am unable to lay the UIImageView with a default image on top of the black screen.  Let me know if you have any suggestions?

Thanks,

 

Jack

black screen after pushing view from my custom viewController t

March 6, 2013 - 1:04am #4

Awesome!

Glad to hear :)

black screen after pushing view from my custom viewController t

March 5, 2013 - 9:40pm #3

Thanks, NalinS  , it is work now 

black screen after pushing view from my custom viewController t

March 4, 2013 - 9:30am #2

Hi Vincentwts,

This line indicates the problem:

VideoBackgroundConfig with screen size of zero received, skipping config step

Essentially the code is trying to initiate the AR view with a size of (0,0), so you need to find a way of setting this size.

 

I was able to get this up and running by doing the following:

1 Use a different StartAppDelegate instead of the one that comes with CloudReco:

 

@interface StartAppDelegate : UIResponder <UIApplicationDelegate>

 

@end

 

 

 

@implementation StartAppDelegate

@synthesize window = _window;

 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    // Create the CR-specific QCARutils object to replace the standard one and

    // set the device orientation lock to automatic mode

    CRQCARutils *qUtils = [CRQCARutils getInstance];

    qUtils.deviceOrientationLock = DeviceOrientationLockAuto;

    

    CGRect screenBounds = [[UIScreen mainScreen] bounds];

//    _window = [[UIWindow alloc] initWithFrame: screenBounds];

    

    

    // Override point for customization after application launch - allows my collection view controller rather than the default    

    return YES;

}

 

- (void)applicationWillResignActive:(UIApplication *)application

{

    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

}

 

- (void)applicationDidEnterBackground:(UIApplication *)application

{

    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}

 

- (void)applicationWillEnterForeground:(UIApplication *)application

{

    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

}

 

- (void)applicationDidBecomeActive:(UIApplication *)application

{

    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

}

 

- (void)applicationWillTerminate:(UIApplication *)application

{

    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

}

 

@end

 

2 - StartViewController as follows: (note that this has just one instance of CRParentViewController that is created once.  This is the recommened way to start/stop Vuforia, otherwise you will encounter problems.  Note also it sets a new variable in CRParentViewController called arViewSize - which is why it will not be zero.

 

@class CRParentViewController;

 

@interface StartViewController : UIViewController

- (IBAction)goButton:(id)sender;

 

@property (strong, nonatomic) CRParentViewController *cameraViewController;

 

@end

 
 
 

@interface StartViewController ()

 

@end

 

@implementation StartViewController

 

@synthesize cameraViewController = _cameraViewController;

 

 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

        // Custom initialization

    }

    return self;

}

 

- (void)viewDidLoad

{

    [super viewDidLoad];

// Do any additional setup after loading the view.

    

    _cameraViewController = [[CRParentViewController alloc] initWithNibName:nil bundle:nil];

 

    // need to set this so subsequent view controllers know the size 

    _cameraViewController.arViewSize = self.view.bounds.size;

}

 

- (void)didReceiveMemoryWarning

{

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}

 

- (void)dealloc

{

    [_cameraViewController release];

    [super dealloc];

}

 

 

- (IBAction)goButton:(id)sender {

 

    [self.navigationController pushViewController:_cameraViewController animated:YES];

}

 

@end

 

3 - In CRParentViewController.h add this

 

@property (nonatomic) CGSize arViewSize;

4 - Replace the following line in loadView

 

    // need to set size here to setup camera image size for AR

//    arViewController.arViewSize = arViewRect.size;

 

    // set size so its not zero

    arViewController.arViewSize = arViewSize;

    

    [parentView addSubview:arViewController.view];

 

...and if all goes well you should have a CloudReco View controller that gets pushed onto the navigation controller that you can transition in and out of :)

 

HTH

N

Log in or register to post comments