Exemple #1
0
def test(image, char=None):
    classifications = ContClassifications()
    image = adjust_aspect(image, binarize=True)
    cont = cont_angles(image)
    for c, a in cont_table.angles.items():
        #print c
        corr, error = cont_corr(cont, a)#, show=(c in 'PoDBi'))
        #print ("corr(%s, %s) = %.3f; error = %.1f" % (char, c, corr, error))
        classifications.add(c, corr, error)

    return classifications
Exemple #2
0
 def add(self, char, image):
     image = adjust_aspect(image, binarize=True)
     self._cont[char] = cont_angles(image)