(img, HThresh=25)
| 136 | |
| 137 | |
| 138 | def resizeAug(img, HThresh=25): |
| 139 | if img.shape[0] > HThresh: |
| 140 | h, w = img.shape[:2] |
| 141 | ratio = np.random.randint(4, 8) / 10. |
| 142 | img = cv2.resize(img, None, fx=ratio, fy=ratio) |
| 143 | img = cv2.resize(img, (w, h)) |
| 144 | return img |
| 145 | |
| 146 | |
| 147 | def random_dilute(image, sele_value=50, set_value=20, num_ratio=[0.1, 0.2]): |