Log in or register to post comments

Disable/Enable camera and tracking

February 6, 2013 - 1:13pm #1

Hi!

My question is: What is the best way to disable/enable the camera and tracking behaviour?

I tried using CameraDevice.Instance.Start() and CameraDevice.Instance.Stop() and it does the trick but after repeatedly calling these functions the camera starts to lag reaaal hard (and I mean it). The reason I want to turn it on and off repeatedly is because of performance issues; e.g. when I'm in the menu part of our app there is no need for the camera/tracking to run in the background (our app is divided into different parts, where one part is the camera/tracking). Atm I'm forced to have the camera/tracking enabled at all time, even if I'm in the menu, which isn't very nice.

Any ideas or help would be very much appreciated!

Thanks, Louise

Disable/Enable camera and tracking

February 9, 2013 - 7:31pm #4

 

I am struggling with the camera lag issue as well. For me, disabling QCARBehaviour is no option because I made some modifications to that file which need to be executed to get UCS to work correctly.

I do not need the tracking algorithm to stop to save CPU time though. I just need to freeze the video frame. With PointCloud and String, the video frame freezing is instantaneous and doesn't come with any additional latency bugs. This is because they just stop updating the GL video texture. The freezing of the marker transforms I can do myself. So I know it is possible.

Please consider improving the freeze feature, it will be much appreciated.

 

Disable/Enable camera and tracking

February 6, 2013 - 3:30pm #3

I tried to disable/enable QCARBehaviour and it works like a charm! I toggled it on and off repeatedly at a fast pace too and the camera doesn't seem to lag at all, so far so good! There's only a slight (~1 sec) delay when going from the menu to the camera but that's understandable since it has to start the camera.

Thank you so much for the help and for answering so fast!

Disable/Enable camera and tracking

February 6, 2013 - 1:42pm #2

Try disabling the QCARBehaviour on the ARCamera, see: https://developer.vuforia.com/resources/dev-guide/special-options-unity

Enabling and disabling AR objects

Enabling and disabling the various QCAR behaviours works as expected in Unity.

  • Disable the QCARBehaviour to stop the tracker and the camera, freeing up CPU cycles for menus or other non-AR application behavior.
  • Disable TrackableBehaviours or VirtualButtonBehaviours to prevent these objects from receiving updates from the tracker.
  • Re-enable TrackableBehaviours or VirtualButtonBehaviours to restore these updates.

 

Some devices are especially sensitive to what you're encountering. This isn't a Vuforia issue, it's arising from the underlying device hardware and OS. You may find that you'll need to impose a limit on how rapidly the camera is toggled on and off, and allow it to remain on at times when the menus are presented.

Log in or register to post comments