Write a image, input uint8 RGB array of shape (H, W, 3).
(path: Union[str, os.PathLike, IO], image: np.ndarray, quality: int = 95)
| 76 | |
| 77 | |
| 78 | def write_image(path: Union[str, os.PathLike, IO], image: np.ndarray, quality: int = 95): |
| 79 | """ |
| 80 | Write a image, input uint8 RGB array of shape (H, W, 3). |
| 81 | """ |
| 82 | data = cv2.imencode('.jpg', cv2.cvtColor(image, cv2.COLOR_RGB2BGR), [cv2.IMWRITE_JPEG_QUALITY, quality])[1].tobytes() |
| 83 | if isinstance(path, (str, os.PathLike)): |
| 84 | Path(path).write_bytes(data) |
| 85 | else: |
| 86 | path.write(data) |
| 87 | |
| 88 | |
| 89 | def read_depth(path: Union[str, os.PathLike, IO]) -> Tuple[np.ndarray, float]: |
nothing calls this directly
no outgoing calls
no test coverage detected