utils
get_camera_extrinsic_params_filename(robot_id, name, codec, width, height)
#
Get parameters filename based on current package path and camera parameters
Source code in cogip/tools/camera/utils.py
116 117 118 119 120 121 122 123 124 125 126 |
|
get_camera_intrinsic_params_filename(robot_id, name, codec, width, height)
#
Get parameters filename based on current package path and camera parameters
Source code in cogip/tools/camera/utils.py
86 87 88 89 90 91 92 93 94 95 96 |
|
is_rotation_matrix(R)
#
Checks if a matrix is a valid rotation matrix
Source: https://www.learnopencv.com/rotation-matrix-to-euler-angles/
Source code in cogip/tools/camera/utils.py
21 22 23 24 25 26 27 28 29 30 31 |
|
load_camera_extrinsic_params(path)
#
Loads camera position relative to robot center.
Source code in cogip/tools/camera/utils.py
134 135 136 |
|
load_camera_intrinsic_params(path)
#
Loads camera matrix and distortion coefficients.
Source code in cogip/tools/camera/utils.py
107 108 109 110 111 112 113 |
|
rotate_2d(vector, angle)
#
Rotate a 2D point with specify angle
Source code in cogip/tools/camera/utils.py
60 61 62 63 64 65 66 |
|
rotation_matrix_to_euler_angles(R)
#
Calculates rotation matrix to euler angles. The result is the same as MATLAB except the order of the euler angles (x and z are swapped).
Source: https://www.learnopencv.com/rotation-matrix-to-euler-angles/
Source code in cogip/tools/camera/utils.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
save_camera_extrinsic_params(params, path)
#
Save the camera position relative to robot center to given path/file.
Source code in cogip/tools/camera/utils.py
129 130 131 |
|
save_camera_intrinsic_params(camera_matrix, dist_coefs, path)
#
Save the camera matrix and the distortion coefficients to given path/file.
Source code in cogip/tools/camera/utils.py
99 100 101 102 103 104 |
|
wrap_to_pi(angle)
#
Wrap angle to PI, return a angle value between -PI
and PI
Parameters:
Name | Type | Description | Default |
---|---|---|---|
angle |
float
|
Angle in radians |
required |
Returns:
Type | Description |
---|---|
float
|
Wrapped angle, in radians |
Source code in cogip/tools/camera/utils.py
69 70 71 72 73 74 75 76 77 78 |
|