Ejemplo n.º 1
0
 def preprocess(self, image):
     desl = imgproc.deslant(image)
     return imgproc.hog(desl, NUM_BINS, NUM_CELLS / 2)
Ejemplo n.º 2
0
 def preprocess(self, image):
     desl = imgproc.deslant(image)
     w, u, vt = cv2.SVDecomp(desl.astype(np.float32))
     sigma = np.diag(w.ravel())
     n = 26
     return u[:n, :n].dot(sigma[:n, :n]).dot(vt[:n, :n])
Ejemplo n.º 3
0
 def preprocess(self, image):
     desl = imgproc.deslant(image)
     return imgproc.crop_to_outer_contour(desl, NORMALISED_SIZE)