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:

Tuple[Matrix21, float, Matrix, Matrix]

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:

Tuple[Matrix31, float, Matrix, Matrix]

make_camera_funcs(cls, config)[source]

Create func spec arguments for common camera operations for the given class.

Parameters:
Return type:

List[Codegen]

cam_class_data(cls, config)[source]

Data for template generation of this class. Contains all useful info for class-specific templates.

Parameters:
Return type:

Dict[str, Any]

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]

camera_data()[source]
Return type:

Dict[str, Any]

posed_camera_data()[source]
Return type:

Dict[str, 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.

Parameters:
Return type:

CamCls

generate(config, output_dir=None)[source]

Generate the cam package for the given language.

Parameters:
Return type:

Path