pycvcam.core.Transform.to_dict#

Transform.to_dict()[source]#

Serialize the transformation to a dictionary.

Here is an example of the dictionary structure:

from pycvcam import Cv2Distortion
from pycvcam import write_transform

distortion = Cv2Distortion(...)
distortion.parameters = numpy.array([0.1, 0.2, 0.3, 0.01, 0.5])
disto_dict = distortion.to_dict()

The content of the dict will be similar to:

{
    "type": "Cv2Distortion",
    "version": "1.3.0",
    "date": "2023-01-01T00:00:00",
    "parameters": [0.1, 0.2, 0.3, 0.01, 0.5],
    "constants": null
}

See also

  • from_dict() : Method to create a Transform object from a dictionary.

  • to_json() : Method to write the Transform object to a JSON file.

Returns:

A dictionary representation of the transformation.

Return type:

Dict[str, Any]