Log in or register to post comments

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 28, 2014 - 2:25am #1

Hi, i'm testing my app and i got a serious problem, after more than a week of test i decided to ask here.

 

My app got one scene using Vuforia and another without it (Scene A, Scene B).

 

It starts on Scene A then using a GUI button it loads Scene B.

Once on Scene B the user can take a picture and use it as a 2DTEXTURE on a plane and add 2D Elements on the top.

 

If i click the BACK Button and load Scene A, the App crashes becasue Vuforia still got the camera access.

 

How can i completely Deinit, stop or Destroy any Camera Access from Vuforia and then re start it?

 

Ale.

PS: I tried to Load Scene B and if i don't use the Camera Access from Prime31's Etctera the app doesn't crash.

On the other side i tried to use many other plug in to take a picture and the result is exactly the same....crash.

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 30, 2014 - 5:27am #8

Have you checked the code snippet in this article:

https://developer.vuforia.com/forum/faq/unity-how-can-i-capture-screen-shot

I just tried it on a few devices here, and this seems to work fine also when using the Front camera (i.e. I can capture the screenshot and the shot also includes the UI buttons that I have placed on top, as well as the "teapot" 3D augmentation)

Are you integrating some custom UI framework ?

 

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 30, 2014 - 1:35am #7

Hi Alessandro,

My app contains many features in AR and only one not AR (it is a photobooth).

On the photobooth i need to take a picture of the user's face (front camera) then use the picture as a texture and add images on the top of it, then i just use Application.capturescreenshot to grab the final image.

I gave up using external plug ins to take the first picture and decided to use the ARcamera.

The problem is that if i use the front camera its hiding all the images on the top as well as the gui (including the final screenshot.

The app was working fine on unity 4.2.2 and vuforia pre 2.8.7 now i got this problem, and i can't go back to the 4.2.2 version becasue i'm also using another plug in for In App Purchase that runs only on unity 4.3.3.

I was wondering if there was any method to completely deinit Vuforia like it was never opened. Becasue if i never open a Vuforia scene and use the imagepicker and then open Vuforia it works, viceversa, not working.

 

PS: I tried both methods but the camera its in front of everything while i set FRONT camera, BACK camera works fine but i need the other one.

Ale.

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 30, 2014 - 1:18am #6

One question:

are you trying to take a screenshot of the AR view ? (i.e. video background + some augmentation) ?

if so, have you tried this method:

http://docs.unity3d.com/Documentation/ScriptReference/Application.CaptureScreenshot.html

?

 

Also, if you are trying to capture the camera image (i.e. just the video background), you could use the approach detailed here:

https://developer.vuforia.com/resources/dev-guide/unity-camera-image-access

 

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 30, 2014 - 12:04am #5

AlessandroB wrote:

however if i set it back to true (even later in other scenes) its still crashing the app.

This seems to suggest that the Prime31 plugin may be still holding the camera; so, while in the previous case it was Vuforia holding the camera,   now the situation seems symmetric..  

I would suggest checking if you can tell the Prim31 plugin to release the camera before re-enabling QCARBehaviour.

 

 

Hi AlessandroB,

i asked Prime31 and he says that is Vuforia that grabs the cameraAccess all over the app and never release it.

I tried to use 3 different plug ins to to the prompt for the camera or photogallery and still the same issue, it crashes once i open a scene with the Vuforia camera.

I gave up and tried to do a completely different method, using the Vuforia camera to take the first screenshot and it works but if i use the Front camera it goes on the top of my gui, if i use the BACK camera its working (but of course i need the front camera).

 

How is this possible? i mean, its the same camera with the same settings and if i use BACK works, if i use FRONT its in front of the gui (including the screenshot used as a texture).

 

UPDATE: I tried to open the promptforphoto before opening the main vuforia scene and after taking the picture and going to the vuforia scene it works but i i than go back to take a picture and try again it crashes.
Basically once i open a Vuforia scene for the first time it stays in memory all the time even in a scene without an ARCamera and with the KeepAliveBehaviour disabled. PANIC.

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 29, 2014 - 3:40am #4

however if i set it back to true (even later in other scenes) its still crashing the app.

This seems to suggest that the Prime31 plugin may be still holding the camera; so, while in the previous case it was Vuforia holding the camera,   now the situation seems symmetric..  

I would suggest checking if you can tell the Prim31 plugin to release the camera before re-enabling QCARBehaviour.

 

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 28, 2014 - 2:55pm #3

Hi AlessandroB, thanks!

I tried and when its false it goes back to the main scene, however if i set it back to true (even later in other scenes) its still crashing the app.

 

I'm stuck.

 

Vuforia+Prime31Etcetera, Take Picture=CRASH

January 28, 2014 - 6:30am #2

Hi,

one way of stopping the Vuforia Camera is to retrieve the QCARBehaviour component (this component is attached to the ARCamera in your scene) and disable it; this can be done with code like this:

 QCARBehaviour qcar = (QCARBehaviour)FindObjectOfType(typeof(QCARBehaviour));
 if (qcar) {  
    qcar.enabled = false; 
  
  }

  ////

 

 

 

Log in or register to post comments