-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathlensmodel_num_params.docstring
37 lines (26 loc) · 1.4 KB
/
lensmodel_num_params.docstring
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Get the number of lens parameters for a particular model type
SYNOPSIS
print(mrcal.lensmodel_num_params('LENSMODEL_OPENCV4'))
8
I support a number of lens models, which have different numbers of parameters.
Given a lens model, this returns how many parameters there are. Some models have
no configuration, and there's a static mapping between the lensmodel string and
the parameter count. Some other models DO have some configuration values inside
the model string (LENSMODEL_SPLINED_STEREOGRAPHIC_... for instance), and the
number of parameters is computed using the configuration values. The lens model
is given as a string such as
LENSMODEL_PINHOLE
LENSMODEL_OPENCV4
LENSMODEL_CAHVOR
LENSMODEL_SPLINED_STEREOGRAPHIC_order=3_Nx=16_Ny=12_fov_x_deg=100
The full list can be obtained with mrcal.supported_lensmodels()
Note that when optimizing a lens model, some lens parameters may be locked down,
resulting in fewer parameters than this function returns. To retrieve the number
of parameters used to represent the intrinsics of a camera in an optimization,
call mrcal.num_intrinsics_optimization_params(). Or to get the number of
parameters used to represent the intrinsics of ALL the cameras in an
optimization, call mrcal.num_states_intrinsics()
ARGUMENTS
- lensmodel: the "LENSMODEL_..." string we're querying
RETURNED VALUE
An integer number of parameters needed to describe a lens of the given type