MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / set_mat_np

Method set_mat_np

detrsmpl/core/cameras/camera_parameters.py:195–210  ·  view source on GitHub ↗

Set a matrix-type parameter to mat_numpy. Args: mat_key (str): Key of the target matrix. in_mat or rotation_mat. mat_numpy (ndarray): Matrix in numpy format. Raises: TypeError: mat_numpy

(self, mat_key: str, mat_numpy: np.ndarray)

Source from the content-addressed store, hash-verified

193 raise ValueError(f'K mat cannot be converted to {k_dim}x{k_dim}')
194
195 def set_mat_np(self, mat_key: str, mat_numpy: np.ndarray) -> None:
196 """Set a matrix-type parameter to mat_numpy.
197
198 Args:
199 mat_key (str):
200 Key of the target matrix. in_mat or rotation_mat.
201 mat_numpy (ndarray):
202 Matrix in numpy format.
203
204 Raises:
205 TypeError:
206 mat_numpy is not an np.ndarray.
207 """
208 if not isinstance(mat_numpy, np.ndarray):
209 raise TypeError
210 self.set_mat_list(mat_key, mat_numpy.tolist())
211
212 def set_mat_list(self, mat_key: str, mat_list: List[list]) -> None:
213 """Set a matrix-type parameter to mat_list.

Callers 4

set_KRTMethod · 0.95
load_kinect_from_smcMethod · 0.95
load_iphone_from_smcMethod · 0.95

Calls 1

set_mat_listMethod · 0.95

Tested by

no test coverage detected