Skip to content

Instantly share code, notes, and snippets.

View sushant097's full-sized avatar
⬆️
1% daily improvement

sushant097 sushant097

⬆️
1% daily improvement
View GitHub Profile
@sushant097
sushant097 / iam_dataset_augment_final.py
Created November 15, 2020 07:27
Complete Data Augmentation code for IAM dataset
import numpy as np
import cv2
from scipy import ndarray
import skimage as sk
from skimage import transform
from skimage import util
import random
def random_noise(image_array: ndarray):
@sushant097
sushant097 / iam_dataset_augment1.py
Created November 15, 2020 06:46
Data Augmentation of IAM dataset for handwritten line text recognition
'''
Augment IAM dataset:
reduce_line_thickness, --> Reduce the line thickness
random_noise, --> Introduce random noise on image
blur_filter, --> Blur the image
random_stretch --> Random stretch to image
'''
def reduce_line_thickness(image: ndarray):
kernel = np.ones((4,4), np.uint8)
return cv2.dilate(image, kernel, iterations=1)