Read image and output RGB image (0-1). Args: path (str): path to file Returns: array: RGB image (0-1)
(path)
| 95 | |
| 96 | |
| 97 | def read_image(path): |
| 98 | """Read image and output RGB image (0-1). |
| 99 | |
| 100 | Args: |
| 101 | path (str): path to file |
| 102 | |
| 103 | Returns: |
| 104 | array: RGB image (0-1) |
| 105 | """ |
| 106 | img = cv2.imread(path) |
| 107 | |
| 108 | if img.ndim == 2: |
| 109 | img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) |
| 110 | |
| 111 | img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) / 255.0 |
| 112 | |
| 113 | return img |
| 114 | |
| 115 | |
| 116 | def resize_image(img): |
nothing calls this directly
no outgoing calls
no test coverage detected