Module utils.py


class utils.Sequence(configparams)[source]
Parameters:
configparams : dict

Configuration parameters. This dictionary contains information about necessary files directories, as well as the values for various parameters used by the system.

Attributes:
height : int

height of the camera (important for intrinsic matrix).

width : int

width of the camera (important for intrinsic matrix).

K : numpy matrix, type float32

Matrix with shape [3, 3] representing the intrinsic matrix of the camera.

Rs : list of numpy matrix, type float32

List of numpy matrices with shape [3, 3] representing the rotations of the camera during the sequence.

Ts : list of numpy matrix, type float32

List of numpy matrices with shape [1, 3] representing the translations of the camera during the sequence.

I : list of numpy arrays, type float32

List of numpy arrays with shape [h,w,3], representing the images in the sequence. It must be true that end - start = len(I)

D : list of numpy arrays, optional, type uint16

List of numpy arrays with shape [h,w], containing previously estimated depth-maps of the sequence. If this parameter is passed as input then the sequence will use bundle optimization. It must be true that end - start = len(I).

Methods

use_bundle() Return if this sequence can be used for bundle optimization, that is, if it contains previously estimated depth-maps.
use_bundle()[source]

Return if this sequence can be used for bundle optimization, that is, if it contains previously estimated depth-maps.

Returns:
bool

Whether the sequence can be used with bundle optimization.


utils.parse_configfile(filename)[source]

Parse a configuration file and return a dictionary containing the various parameters used by the system.

For a more in detail explanation of the parameters contained in the configuration file, and its format see Configuration File.

Parameters:
filename : str or unicode

Relative or absolute path to the configuration file.

Returns:
dict

Dictionary containing the system parameters. If a parameter-value pair was not in the configuration file then its value is None.