MCPcopy Create free account
hub / github.com/DNA-Rendering/DNA-Rendering / get_Calibration_all

Method get_Calibration_all

scripts/3DGS/SMCReader.py:74–102  ·  view source on GitHub ↗

Get calibration matrix of all cameras and save it in self Args: None Returns: Dictionary of calibration matrixs of all matrixs. dict( Camera_Parameter: Camera_id : Matrix_type : value ) Notice:

(self)

Source from the content-addressed store, hash-verified

72
73 ### RGB Camera Calibration
74 def get_Calibration_all(self):
75 """Get calibration matrix of all cameras and save it in self
76
77 Args:
78 None
79
80 Returns:
81 Dictionary of calibration matrixs of all matrixs.
82 dict(
83 Camera_Parameter: Camera_id : Matrix_type : value
84 )
85 Notice:
86 Camera_id(str) in {'Camera_5mp': '0'~'47', 'Camera_12mp':'48'~'60'}
87 Matrix_type in ['D', 'K', 'RT', 'Color_Calibration']
88 """
89 if not 'Camera_Parameter' in self.smc:
90 print("=== no key: Camera_Parameter.\nplease check available keys!")
91 return None
92
93 if self.__calibration_dict__ is not None:
94 return self.__calibration_dict__
95
96 self.__calibration_dict__ = dict()
97 for ci in self.smc['Camera_Parameter'].keys():
98 self.__calibration_dict__.setdefault(ci,dict())
99 for mt in ['D', 'K', 'RT', 'Color_Calibration'] :
100 self.__calibration_dict__[ci][mt] = \
101 self.smc['Camera_Parameter'][ci][mt][()]
102 return self.__calibration_dict__
103
104 def get_Calibration(self, Camera_id):
105 """Get calibration matrixs of a certain camera by its type and id

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected