symforce.codegen.cam_package_codegen module¶
- pixel_from_camera_point_with_jacobians(self, point, epsilon)[source]¶
Project a 3D point in the camera frame into 2D pixel coordinates.
- Returns:
pixel – (x, y) coordinate in pixels if valid
is_valid – 1 if the operation is within bounds else 0
pixel_D_cal – Derivative of pixel with respect to intrinsic calibration parameters
pixel_D_point – Derivative of pixel with respect to point
- Parameters:
- Return type:
- camera_ray_from_pixel_with_jacobians(self, pixel, epsilon)[source]¶
Backproject a 2D pixel coordinate into a 3D ray in the camera frame.
- Returns:
camera_ray – The ray in the camera frame (NOT normalized)
is_valid – 1 if the operation is within bounds else 0
point_D_cal – Derivative of point with respect to intrinsic calibration parameters
point_D_pixel – Derivation of point with respect to pixel
- Parameters:
- Return type:
- make_camera_funcs(cls, config)[source]¶
Create func spec arguments for common camera operations for the given class.
- Parameters:
cls (Type) –
config (CodegenConfig) –
- Return type:
- cam_class_data(cls, config)[source]¶
Data for template generation of this class. Contains all useful info for class-specific templates.
- Parameters:
cls (Type) –
config (CodegenConfig) –
- Return type:
- class_template_data(cls, functions_to_doc)[source]¶
- Parameters:
cls (T.Type) –
functions_to_doc (T.Sequence[function]) –
- Return type:
T.Dict[str, T.Any]
- cam_cal_from_points(cam_cls, focal_length, principal_point)[source]¶
Returns an instance of cam_cls with given focal_length and prinicpal_point. The purpose of this function is to make it easy to construct camera cals of various types without worrying what the extra arguments need to be.
- generate(config, output_dir=None)[source]¶
Generate the cam package for the given language.
- Parameters:
config (CodegenConfig) –
output_dir (Path | None) –
- Return type: