utils
decompose_transform_matrix(M)
#
Decompose a 4x4 transformation matrix into rotation matrix and translation vector.
Source code in cogip/tools/camera/utils.py
104 105 106 | |
euler_angles_to_rotation_matrix(theta)
#
Calculates rotation matrix from euler angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta
|
ArrayLike
|
Euler angles in radians (roll, pitch, yaw) |
required |
Source code in cogip/tools/camera/utils.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
extrinsic_params_to_matrix(params)
#
Convert camera extrinsic parameters to a 4x4 transformation matrix.
Source code in cogip/tools/camera/utils.py
109 110 111 112 113 114 115 | |
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
145 146 147 | |
load_camera_intrinsic_params(path)
#
Loads camera matrix and distortion coefficients.
Source code in cogip/tools/camera/utils.py
131 132 133 134 135 136 137 | |
make_transform_matrix(R, t)
#
Create a 4x4 transformation matrix from rotation matrix and translation vector.
Source code in cogip/tools/camera/utils.py
96 97 98 99 100 101 | |
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
140 141 142 | |
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
123 124 125 126 127 128 | |