def preprocess(self, image): desl = imgproc.deslant(image) return imgproc.hog(desl, NUM_BINS, NUM_CELLS / 2)
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])
def preprocess(self, image): desl = imgproc.deslant(image) return imgproc.crop_to_outer_contour(desl, NORMALISED_SIZE)