You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Models defined outside NCore are now supported end to end. 19.6.0 introduced register_camera_model and its lidar and external distortion counterparts, but registration only reached half way: an out-of-tree model could be constructed, then rejected by IdealPinholeCameraModelParameters.from_source / natural_fov, which dispatched over a hard-coded chain of the four in-tree models, and could never be read back, because decode_camera_model_parameters dispatched over a hard-coded table of the four in-tree identifiers. Both are now open.
CameraModelParameters.paraxial_pinhole_geometry is the single extension point behind the ideal pinhole helpers. A model declares the pinhole that agrees with it to first order about the optical axis, as a ParaxialPinholeGeometry, and the helpers work on it without knowing which model they were handed. A model with no meaningful paraxial pinhole opts out by raising TypeError.
decode_camera_model_parameters and decode_lidar_model_parameters resolve the serialized identifier through a registry, with register_camera_model_parameters and register_lidar_model_parameters as the deserialization counterparts to the model factories'
registration hooks. No serialized format changed: the identifier was already written from type(), so existing data reads exactly as before, including payloads using the retired pinhole identifier.
Serialized external distortion parameters carry their concrete type inside the nested object, which is what lets CameraModelParameters.external_distortion_parameters be declared against the abstract base. Untagged payloads written before this are still read, as the bivariate windshield model.
The reader and writer APIs are typed against the abstract parameter bases rather than closed unions of the concrete classes. Callers of decode_* and of the model_parameters accessors now receive the abstract base and may need an isinstance narrow before reading a model-specific field.
The abstract lidar parameter bases are exported as LidarModelParameters, SpinningLidarModelParameters and StructuredSpinningLidarModelParameters, restoring symmetry with the camera side, which has exported its abstract base since 19.6.0.
Concrete parameter classes must now implement type, and concrete camera parameters paraxial_pinhole_geometry; both are abstract on their bases rather than defaulted. Subclasses that do not will raise TypeError on instantiation. Every model in NCore does, and the requirement is stated now, while no out-of-tree model exists to be broken by it.