in digit_interface/digit.py [0:0]
def get_frame(self, transpose: bool = False) -> np.ndarray:
"""
Returns a single image frame for the device
:param transpose: Show direct output from the image sensor, WxH instead of HxW
:return: Image frame array
"""
ret, frame = self.__dev.read()
if not ret:
logger.error(
f"Cannot retrieve frame data from {self.serial}, is DIGIT device open?"
)
raise Exception(
f"Unable to grab frame from {self.serial} - {self.dev_name}!"
)
if not transpose:
frame = cv2.transpose(frame, frame)
frame = cv2.flip(frame, 0)
return frame