Skip to main content
Skip table of contents

Variable Focus

1 Preface

Pixotope camera tracking systems work with two different lens calibration types that map the parameters of the lens’ projection on the chip and compile them for the graphics engine. Commonly used are zoom lens calibrations (ZLC). Prime lenses require less measurements due to the fixed focal length. They can be calibrated quickly with the included software called Fixed Lens Calibration (FLC).

This document is a guide about how to create a fixed lens calibration for a prime lens for the use as a Pixotope Vision/Marker Chief lens calibration file. As these lenses are likely to have to change the focus during operation, the lens breathe has to be taken into account. This means the change of parameters, mainly field of view and distortion, during focus operation. Furthermore, the varying focus distances may be measured if it is desired to apply defocus to the graphics.

single_encoder.jpg

Illustration 1: External focus encoder

This guide covers only the differences of calibrating variable focus for a FLC file. It is directed at experienced users who know the basics already. The process requires a fully operational Pixotope Vision or Marker system with an external lens encoder for the focus ring.

The manual for creating a fixed lens calibration can be found here.

1.1 Working Principle

A proper calibration will be done for multiple focus ring settings. Each calibration captures lens parameters like distortion, field of view and image center. The system will interpolate between these calibrations when the focus is changed. Both end stops, Infinity and MOD, must always be calibrated.

2 Variable Focus Calibration

2.1 Preparations

2.1.1 Preparations - Chief

  1. Start Pixotope Vision or Marker Chief

  2. Select External Focus Encoder under Lens and click Save + Quit/Restart

chiefsetup_varfoc.jpg

Illustration 2: Chief Setup for external focus encoder

  1. In the Chief window, switch to the Focus tab and select the USB converter of the focus encoder that is connected to the computer

  2. Save and restart

  3. Check the Dump counter option in the Focus tab. The system log will print the encoder values, abs meaning the raw encoder counter while rel shows the normalized value between 0 and 1

  4. Change focus all the way, from infinite to minimum object distance and back, to teach the system the minimum and maximum range

  5. When the focus of the lens is set to infinite all the way, the rel-value should be 0. When the focus of the lens is set to minimum object distance all the way, the rel-value should be 1. If these values are swapped, you can activate Invert counting direction. You would need to repeat steps 3 to 5 in that case

Make sure to have the infinite and the MOD measurement at the absolute end of the focus ring range, not at the marking on the lens. Most lenses exceed these markings by a bit, so rotate the ring until it meets its complete stop.

Note that the relative value for Maximum and Minimum may not be exactly 0 and 1, but values very close to it, like 1.2875e-5 and 0.99997.

  1. Save and close the Chief using the AppManager Stop button

2.1.2 Preparations - Focus Distance Editor

  1. Open the Software Manager. The root password is: tmgmbh51105k

  2. Go to Configurations and to Repositories

  3. Activate Enable and Automatically Refresh of the openSUSE.org Repository and click OK

repositories2.jpg

Illustration 3: Enabled openSUSE.org Repository

  1. Go to Repositories and to Network Tracking Repository

  2. Install the trk-tools-flcfocdist package and also make sure that the trk-tools-cli and trk-tools-gui packages are up to date

repositories.jpg

Illustration 4: Install the FLC Focus Distance Editor

  1. Click Accept

  2. Open the FLC Focus Distance Editor

tools_gui.jpg

Illustration 5: Starting the FLC Focus Distance Editor

  1. It will automatically select the USB converter for the focus encoder as Device based on the setting saved in the Chief config file

  2. It will also remind you to initialize by turning the focus ring from end to end. Go ahead and do this

focuseditor_start.jpg

Illustration 6: FLC Focus Distance Editor at start

2.1.3 Preparations - Fixed Lens Calibration Program

  1. Start the Fixed Lens Calibration program while leaving the FLC Focus Distance Editor running

  2. If necessary set the right settings in the Camera and Pattern tab

As the image may be defocused in calibration pattern distance, it is recommended to close the iris as far as possible to have maximum depth of field. That can make it necessary to increase the brightness of the environment and/or the gain of the camera

  1. Open the settings and activate Show expert settings. Then switch to the Main tab and check the Enable Encoder option. Save, close and restart the program to apply

main_menu.jpg

Illustration 7: Fixed Lens Calibration settings

2.1.4 Preparations - Determining Focus Ring Positions

Define a number of focus positions that you want to calibrate. For each of these focus ring positions a lens calibration will be done. The system will interpolate between these calibrations when the focus is changed. Both end stops, Infinity and MOD, must always be calibrated.

Four should suffice for a lens with little parameter change during focus operation. Increase the number for lenses with more severe changes in field of view and/or distortion.

In this example, four focus settings will be used making it these focus positions:

encoder rel-value: 0.0 (Infinity)

encoder rel-value: 0.333

encoder rel-value: 0.667

encoder rel-value: 1.0 (MOD)

2.2 Capturing Multiple Focus Positions

  1. Have both, Fixed Lens Calibration and Focus Distance Editor running

  2. Set the focus ring to the Infinity end stop for the first calibration run

  3. For the first calibration run, with the focus set to Infinity, leave the Encoder value at 0.0 and perform a lens calibration as usual

  4. Save the first calibration for the Infinity end stop twice. One file will only be used for the offset calibration between Chief and Worker later on. The other one will be the one that contains multiple calibrations

    1. Click Save and enter a filename recognizable for the offset calibration in the upcoming dialog box. Then click save (example: “Prime_20mm_FullHD_Offset”)

    2. Click Save again, this time entering a file name that can be recognized as having multiple focus positions calibrated (example: “Prime_20mm_FullHD_VariableFocus”)

  5. Close and restart the Fixed Lens Calibration program

  6. Set the next focus ring position on the lens. In our example this is the Encoder value 0.333. The Focus Distance Editor can be used to approximate this position

focuseditor_2.jpg

Illustration 8: Use Focus Distance Editor to set the focus ring to the right position

  1. On the right side of the calibration window, check the Append calibration option

  2. Enter the current Relative Encoder Value in Encoder value

FLC_calib.jpg

Illustration 9: Encoder value and Append calibration option

  1. Perform another lens calibration as usual

  2. Click Save. This time, a dialog box will open, offering to choose a calibration file from existing lens calibrations

  3. Choose the file saved for multiple focus calibrations (example: “Prime_20mm_FullHD_VariableFocus”) and confirm with Save

saving1.jpg

Illustration 10: Choose the file to store multiple calibrations

  1. Repeat steps 5 to 11 until all focus positions have been calibrated and saved into the same calibration file

In the last calibration, the one for the end stop of the closest focus (MOD), the Encoder value must be set to 1.0, even if the Focus Distance Editor actually reads 0.9999 or similar.

  1. Close the Fixed Lens Calibration program

3 Focus distances

In order to apply defocus to virtual graphical elements, the system needs to calculate a focal plane and forward it to the graphics engine. It uses the focus encoder to know what the lens’ focus is set to.

For this to work precisely, the focus distances need to be measured and added to the lens calibration file.

3.1 Preparations

The distance measurements will be done by focusing an object in various distances and noting down the corresponding encoder value. As an object, a Siemens star is optimal to judge the exact focus setting. Besides that, the aperture should be closed to have a smaller depth of field and thereby making it clearer to determine the right focus setting.

Either the object or the camera must be able to be moved, so various distances can easily be created. Depending on the focal length of the lens, a large area may be necessary to provide enough samples.

3.2 Measuring the focus distances

  1. Start the FLC Focus Distance Editor

  2. Initialize by turning the focus ring from end to end

  3. Set the focus to minimum object distance (MOD). The encoder value should now be 1

  4. Place the Siemens star in front of the camera and move it closer to the camera until it is in perfect focus

  5. Measure the distance between flange of the camera and the object

fodist_measure.jpg

Illustration 11: Measuring the focal distance with a Siemens star

  1. Write the distance into the Focus Distance (m) field in the Focus Distance Editor and click the Add button

  2. Move the object away a bit. For example to roughly 1m. Measure that distance to the camera flange

  3. Focus the object and add the second pair of distance and encoder value

focuseditor_4.jpg

Illustration 12: The pairs of values that will be saved into the lens file

  1. Repeat with multiple distances. The number of distances vary with the type of lens. Around 10 will surely suffice for a prime lens

Quick and dirty: If there is no time to take the measurements or the precision is not of importance, you may choose to trust the markings on the lens that give the focus distances. Just position the focus ring to a distance marked on the lens, type in this distance in meters and click Add.

  1. Click Save to .flc File and select the file with the multiple focus calibrations (example: “Prime_20mm_FullHD_VariableFocus”)

  2. It can then be chosen to add a suffix to the filename to indicate that this file has focus distance values in it

  3. Start the Chief and go to the Lens tab

  4. Select the lens file that was just saved

  5. The System Log will print a message that states if the lens file was correctly loaded and how many focus position calibrations and how many focal distance values are in this lens file

syslog_message.jpg

Illustration 13: The System Log will state number of calibrated focus positions and focal distance values

  1. Activate the Dump

  2. The System Log will continuously print the current lens data including the focal distance (focdist)

syslog_dump.jpg

Illustration 14: Lens data dump including focal distance

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.