giant.camera_models.camera_model¶
This module provides an abstract base class (abc) for implementing GIANT camera models.
This abc provides a design guide for building GIANT compatible camera models. All user defined camera models should
probably subclass this class to ensure that they implement all of the required properties and methods that GIANT expects
a camera model to have [1]. In addition, this module provides the functions save()
and load()
which can be
used to write/read camera models from disk in a human and machine readable format.
For a typical use case that doesn’t require a custom camera model, see the PinholeModel
, BrownModel
,
OwenModel
, or OpenCVModel
classes which provide some of the most common models used in optical
navigation. These also serve as examples of how to make a concrete implementation of the CameraModel
abc.
Footnotes
Use¶
To implement a fully functional custom camera model for GIANT, you must implement the following methods in addition to
subclassing the CameraModel
class.
Method |
Use |
---|---|
projects a point from the camera frame onto the image |
|
returns the Jacobian matrix \(\partial\mathbf{x}_P/\partial\mathbf{c}\) where \(\mathbf{c}\) is a vector of camera model parameters (like focal length, pixel pitch, distortion coefficients, etc) and \(\mathbf{x}_P\) is a pixel location. |
|
returns the Jacobian matrix partialmathbf{x}_P/partialmathbf{x}_C` where \(\mathbf{x}_C\) is a vector in the camera frame that projects to \(\mathbf{x}_P\) which is the pixel location. |
|
returns the Jacobian matrix partialmathbf{x}_C/partialmathbf{x}_P` where \(\mathbf{x}_C\) is a unit vector in the camera frame that projects to \(\mathbf{x}_P\) which is the pixel location. |
|
updates the camera model based on a vector of delta camera model parameters |
|
transforms pixel coordinates into unit vectors in the camera frame |
|
takes a distorted pixel location and computes the corresponding undistorted gnomic location in units of pixels |
|
applies the distortion model to gnomic points with units of pixels |
In addition the following methods and attributes are already implemented for most cases but may need to be overridden for some special cases
Method/Attribute |
Use |
---|---|
overwrites the calling instance with the attributes of another instance in place |
|
generates a set of pixel coordinates+distortion values that can be used to create a distortion quiver or contour map. |
|
undistorts an entire image based on the distortion model (returns a warped image) |
|
returns a copy of the current model |
|
a method that stores the model parameters in an element tree element for saving the model to file |
|
a class method that retrieves the model parameters from an element tree element for loading a model from a file |
|
The number of rows in pixels in an image captured by the device modeled by this camera model |
|
The number of columns in pixels in an image captured by the device modeled by this camera model |
|
Half the diagonal field of view of the detector in units of degrees. |
Finally, if the to_elem()
and from_elem()
methods are not being overridden, the
important_attributes
attribute should be extended with a list of attributes that must be
saved/loaded to completely reconstruct the camera model.
Classes
This enumeration is used to specify what should be returned from method |
|
This is the abstract base class for all camera models in GIANT. |
Functions
This function is used to save a camera model to a GIANT xml file. |
|
This function is used to retrieve a camera model from a GIANT xml file. |