8d0d0c7a6db3904f0222cbe058388a92cf21a548,calamari_ocr/thirdparty/ocrodeg/degrade.py,,random_blobs,#Any#Any#Any#Any#,136

Before Change


    mask -= np.amin(mask)
    mask /= np.amax(mask)
    noise = np.random.rand(h, w)
    noise = ndi.gaussian_filter(noise, size/(2*roughness))
    noise -= np.amin(noise)
    noise /= np.amax(noise)
    return np.array(mask * noise > 0.5, "f")

After Change




def random_blobs(shape, blobdensity, size, roughness=2.0):
    h, w = shape[:2]
    numblobs = int(blobdensity * w * h)
    mask = np.zeros((h, w), "i")
    for i in range(numblobs):
        mask[randint(0, h-1), randint(0, w-1)] = 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Calamari-OCR/calamari
Commit Name: 8d0d0c7a6db3904f0222cbe058388a92cf21a548
Time: 2021-02-06
Author: ChWick@users.noreply.github.com
File Name: calamari_ocr/thirdparty/ocrodeg/degrade.py
Class Name:
Method Name: random_blobs


Project Name: Calamari-OCR/calamari
Commit Name: 8d0d0c7a6db3904f0222cbe058388a92cf21a548
Time: 2021-02-06
Author: ChWick@users.noreply.github.com
File Name: calamari_ocr/thirdparty/ocrodeg/degrade.py
Class Name:
Method Name: bounded_gaussian_noise


Project Name: Calamari-OCR/calamari
Commit Name: 8d0d0c7a6db3904f0222cbe058388a92cf21a548
Time: 2021-02-06
Author: ChWick@users.noreply.github.com
File Name: calamari_ocr/thirdparty/ocrodeg/degrade.py
Class Name:
Method Name: printlike_multiscale