Log in or register to post comments

Reset Camera on Undefined

June 27, 2013 - 10:47pm #1

Hi Guys,

What would be the best method to reset the camera when its trackable is Undefined?

My problem is that when I have my camera pointing at an image sometimes it just sits on undefined. It will stay undefined until I move my camera away from the image so it is no longer viewing it and then back in again.  By moving the camera away from the image it seems to reset the camera making it start its tracking from scratch when i move it back over the image.

Thanks!

Reset Camera on Undefined

June 30, 2013 - 7:26pm #7

I can't seem to find the ImageTargetMenu.cs It doesn't come with the package from the website.

I've been calling 

CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO);

But I'm not in the office so I can't test on the devices. On my webcam It doesn't seem to change it's results but it does return in the console that it was successful.

 

[edit]

I tested it on some devices today. the refocus does work but it still sits on undefined.

 

I guess my only solution is to turn off the camera and back turn on again, which is working but it isn't the best solution I think. Is there not something I can call to check again instead of turning off the camera?

Reset Camera on Undefined

June 28, 2013 - 7:28am #6

My suggestion is to experiment and play a bit with the different focus mode and see which one seems to behave the best for your use case.

You can also have a look at the ImageTargetsMenu.cs script in the ImageTargets sample, which shows how to use focus mode with actual code.

 

Reset Camera on Undefined

June 28, 2013 - 6:25am #5

Hey there,

I am using the autofocus and I'm still having the same results. Is there something I can call to make it scan/check the Image again when the status is set to Undefined?

[Edit]

Oh I just realised. Maybe I can try and make the camera focus in and out again? What are your thoughts?

Is this possible in Unity?

I can't test at the moment but I'll try "FOCUS_MODE_TRIGGERAUTO" next.

Reset Camera on Undefined

June 28, 2013 - 1:40am #4

Thanks for the clarifications. 

Based on your description, this is not a problem if "resetting" the camera or the tracker, but it is most likely related to the camera focus adjustment;

are you using continuous autofocus ? if your device supports continuous autofocs, the recommendation is to turn it on (please check the code in ImageTargets.java and ImageTargets.cpp to see how the focus work);

otherwise, if your device does not support continuous autofocs, you can simply touch the screen wiht your finger and this should trigger an auto-focus event which will adjust the image.

See also the API reference of the QCAR::CameraDevice class:

https://developer.vuforia.com/resources/api/class_q_c_a_r_1_1_camera_device

 

 

Reset Camera on Undefined

June 28, 2013 - 1:21am #3

Hi, can you explain the scenario a bit better ?

are you using Image Targets ? does your applicaion detects and tracks the image target ? 

I'm using Image targets. The Images cannot be adjusted to improve tracking. The application does detect the images maybe 1/3 of the times.

The application works fine but im trying to improve the tracking. When the tracking status is set as undefined I want to reset the camera, as if someone has covered the camera with their hand  or moved the camera away from the image and then moved the camera back again. By doing this (resetting the camera) in practice sometimes the image is detected straight away.

Reset Camera on Undefined

June 28, 2013 - 12:22am #2

Hi, can you explain the scenario a bit better ?

are you using Image Targets ? does your applicaion detects and tracks the image target ? 

 

 

Log in or register to post comments