Connecting a camera - ju1ce/April-Tag-VR-FullBody-Tracker GitHub Wiki

Connecting a camera

The first step is connecting a camera feed to your computer, refine its parameters and check whether it meets the requirements for good tracking. You can also use a phone.

OPTIMAL CAMERA FEATURES:

  • Resolution: A resolution of 720p is usually optimal. 480p can work, but you will have reduced range of detection.
  • FPS: While 60fps can help, it is not necessary. 30fps cameras are enough.
  • FOV: Any value will work, but low FOV cameras will reduce your playspace. 90° or more is preferred in order to cover your whole playspace if you put it into a corner.
  • The most important feature of your camera is MANUAL EXPOSURE CONTROL. Not having this feature means that your camera will have motion blur, which will break detection when you move.

Try whatever camera you have before buying any specifically for this!

Best camera app for Android: IP Webcam

Best camera app for iPhones: iOS Camera for OBS Studio

This step is probably the most complex, since you will have to find out what works best for you. Each of the methods has its pros and cons, so try them out and see what works best. If you know of any other option, feel free to use that!

This tutorial only outlines the methods to connect a camera, and their pros and cons. If you have problems related to these, you should refer to their official tutorials. You should get it working before continuing with the tutorial.

A quick comparison of different methods can be found in the Camera method comparison

Tutorial

Below are tutorials for USB webcams, and for the Android app IP-Webcam. Make sure you get it working as optimal as you can before continuing!

To select which camera to open, use the IP/ID of camera parameter. To check whether it is opened properly, press the Open camera button and check the Camera preview checkbox.

Don't forget to set the Quad decimate parameter as well! Good values are 1 for 480p, 2 for 720p and 3 for 1080p. You will refine this parameter later.

start_camrea_button

When camera is opened properly, you will see its resolution and fps in the upper left corner. Make sure it is correct!

camera_preview

There is one more parameter to look at - you can check the Rotate camera parameters to rotate the camera sideways. This will give you more vertical space, meaning you can be closer to the camera. Check both clockwise and counterclockwise to turn it 180°.

USB webcam specific parameters

For usb webcams, the ID/IP of camera will be a number, like 0,1,2 etc. Try a number, save, and attempt to open camera until you find the correct one!

When you find the correct camera, we now have to set the settings correctly. In the params tab, set the camera width and height to the resolution of your camera (1280/720 or 1920/1080 for hd and full hd, but check for your camera specifically!), and set the FPS if it is more than 30.

Second, you want to set Camera API to 700 and check the Open camera settings parameter. This should give you more control over your camera. Next time you open the camera, the following window should open:

camera_gain

camera_exp

Set exposure to -8 (or at least -7) and gain as high as you have to so the image is bright enough. Put it to max if you have to!

If the option is greyed out, your camera probably doesn't support manual exposure.

Camera doesn't open if I use API 700!

Use Camera API preference of 0 then, it will still work fine. You do lose the ability to change exposure using the Open camera settings parameter, however, meaning you will have to use other methods to set exposure, described below.

Camera is low FPS if I use API 700!

Usually, reducing the camera resolution to 720p should be enough. Alternatively, you can use API preference of 0. You do lose the ability to change exposure using the Open camera settings parameter, however, meaning you will have to use other methods to set exposure, described below.

Camera doesn't open no matter the parameters

If camera doesn't open, first step is to plug the camera into another USB port. Try both API preference 0 and 700. If nothing works, you may have to open the camera through OBS, and then bridge the stream into ATT from there using the virtualcam plugin. (you NEED the virtualcam plugin, not the built in virtual camera!)

Connecting to OBS Virtual Camera doesnt work

The built in virtual camera of OBS does not work with ATT, you need to download the virtualcam plugin here. To start the virtualcam through the plugin, go to tools->virtualcam->start.

Alternative methods of setting exposure

If you cannot use the Open camera settings parameter, you may try the last 4 options in the Camera parameters section. Check Enable next 3 parameters, set camera auto exposure to 0, camera exposure to -7 and camera gain to 255, and try to open the camera. You should notice a difference if it worked properly.

Some cameras also come with software that allows setting exposure and gain - if you have that, you can use it as well.

IP Webcam specific parameters

To connect IP Webcam to ATT, you have to write the IP that is written in the app into the IP or ID of camera parameter, adding /video to the end. The final IP will be in the form of http://x.x.x.x:8080/video. Make sure that Camera API preference is set to 0 or it wont work!

For IP Webcam, you can set resolution in the app itself rather than in ATT - try to have a 4:3 aspect ratio, around 800x600 works best. Using more than 720p will increase latency without any real benefit. Use portrait mode if you use all three trackers, and landscape if you only use two and point it at your legs only.

In the downloaded folder, in /utilities, there is a set_exposure.bat script. Edit it, writing in your cameras IP address, and the desired exposure - test a few to find the one with the best brightness, but it should be under 10 ms, or 10000 ns. Running this script will now set the exposure of your phones camera, if your phone supports it.

Alternatively, you can also open the IP in the browser (skip the "/video" part here) and set camera settings here.