Explanation
If the global coordinate system is in an incorrect but consistent position and/or orientation in all camera views, this typically indicates that a different frame was used to set the origin than what was selected in the Chessboard Calibration dialog. This is often caused by the chessboard or its blue squares not being sufficiently visible in the selected Origin Frame, which can be a result of the chessboard being too far from the cameras, challenging lighting conditions, or the cameras being parallel with the surface of the chessboard. In this case, Theia3D searches for the nearest frame in which the chessboard is adequately detected for localization, and uses that frame instead, which can lead to a floating global coordinate system in an undesirable position and orientation.
Possible Solutions
- Use the Enhance Videos tool to improve chessboard visibility.
One approach is the use the Enhance Videos tool to adjust the brightness, contrast, and white balance of the videos in an effort to improve the visibility of the chessboard in the desired origin frame. Use the Blue Mask tool to check if the blue squares are visible in the desired origin frame, and adjust the enhancement settings to improve their visibility. After enhancing the videos, reprocess the calibration trial. - Use the Adjust Origin option within the Object Calibration tool to manually annotate the chessboard in the desired origin position to set the global coordinate system.
To use this approach, open the Object Calibration tool and use Load Object to load a .csv file containing 3D points for the chessboard pattern, or use the Add button to add these points directly. When using a standard Theia Markerless chessboard with 100 millimeter squares, the 3D points that describe the inner corners of the outside corner squares are: (0,0,0), (0,600,0), (300,600,0), and (300,0,0). With the chessboard object points loaded or created, double click on a view where these points are the most visible. While holding control, manually select these positions (i.e. the inner corners of the outer chessboard squares) in this view by carefully clicking on their location. When complete, repeat this process for a total of three or more camera views, then click Adjust Origin. This will maintain the relative positions and orientations of the cameras from the automatic calibration, but will move the reference frame to the correct location. - Use the Adjust Calibration tool to manually move and re-orient the global coordinate system.
The Adjust Calibration tool under the Calibration dropdown menu can be used to modify the position and orientation of the global reference frame, relative to its original position. Use the x, y, and z sliders under the Position and Angle sections to translate and rotate the global coordinate system about those axes of the original global coordinate system. After modifying the global coordinate system as desired, choose Apply or Apply and Save to save the adjusted calibration as a new .txt file. - Use a different origin frame and adjust the chessboard calibration settings (Normal Axis, Long Axis).
Another option to produce a more useful origin is to select a different origin frame and use the Normal Axis and Long Axis values in the Chessboard Calibration dialog to modify the orientation of the global coordinate system relative to the chessboard during the new origin frame selection. For example, selecting a video frame in which the chessboard is positioned vertically standing on its long edge, setting Normal Axis to X, and Long Axis to Y would produce a vertical upwards Z axis and may produce a more useful origin.