histogram equalization added to augmentation

This commit is contained in:
Glenn Jocher 2020-04-10 17:24:49 -07:00
parent 398f8eadec
commit 9bc3a551d9
1 changed files with 5 additions and 0 deletions

View File

@ -520,6 +520,11 @@ def augment_hsv(img, hgain=0.5, sgain=0.5, vgain=0.5):
np.clip(img_hsv[:, :, 0], None, 179, out=img_hsv[:, :, 0]) # inplace hue clip (0 - 179 deg)
cv2.cvtColor(img_hsv, cv2.COLOR_HSV2BGR, dst=img) # no return needed
# Histogram equalization
if random.random() < 0.2:
for i in range(3):
img[:, :, i] = cv2.equalizeHist(img[:, :, i])
def load_mosaic(self, index):
# loads images in a mosaic