File: lensmodel_num_params.docstring

package info (click to toggle)
mrcal 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 8,444 kB
  • sloc: python: 40,601; ansic: 15,576; cpp: 1,754; perl: 303; makefile: 158; sh: 98; lisp: 84
file content (37 lines) | stat: -rw-r--r-- 1,432 bytes parent folder | download | duplicates (5)
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