(img, gt)
| 145 | |
| 146 | |
| 147 | def random_rotation(img, gt): |
| 148 | angle = random.random() * 20 - 10 |
| 149 | h, w = img.shape[:2] |
| 150 | rotation_matrix = cv2.getRotationMatrix2D((w / 2, h / 2), angle, 1) |
| 151 | img = cv2.warpAffine(img, rotation_matrix, (w, h), flags=cv2.INTER_LINEAR) |
| 152 | gt = cv2.warpAffine(gt, rotation_matrix, (w, h), flags=cv2.INTER_NEAREST) |
| 153 | |
| 154 | return img, gt |
| 155 | |
| 156 | |
| 157 | def random_gaussian_blur(img): |
nothing calls this directly
no outgoing calls
no test coverage detected