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

Method get_mat_np

detrsmpl/core/cameras/camera_parameters.py:254–272  ·  view source on GitHub ↗

Get a a matrix-type parameter by key. Args: key (str): Name of the parameter. Raises: KeyError: key not in self.parameters_dict Returns: ndarray: Value of the parameter.

(self, key: str)

Source from the content-addressed store, hash-verified

252 return self.parameters_dict[key]
253
254 def get_mat_np(self, key: str) -> np.ndarray:
255 """Get a a matrix-type parameter by key.
256
257 Args:
258 key (str):
259 Name of the parameter.
260 Raises:
261 KeyError: key not in self.parameters_dict
262
263 Returns:
264 ndarray:
265 Value of the parameter.
266 """
267 if key not in self.parameters_dict:
268 raise KeyError(key)
269 else:
270 mat_list = self.parameters_dict[key]
271 mat_np = np.array(mat_list).reshape((3, 3))
272 return mat_np
273
274 def to_string(self) -> str:
275 """Convert self.to_dict() to a string.

Callers 1

get_KRTMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected