Esempio n. 1
0
 def calculate_single_weight(self, angle):
     """Finds the strongest gradient in the image"""
     obj = ShearTool(self.img)
     corrected = obj.shear(angle)
     p = BinaryProjection(corrected, Projection.TYPE_HORIZONTAL)
     # p.debug()
     return max(np.gradient(p.get_projection())) + abs(min(np.gradient(p.get_projection())))
Esempio n. 2
0
 def calculate_single_weight(self, angle):
     """Finds the strongest gradient in the image"""
     obj = ShearTool(self.img)
     corrected = obj.shear(angle)
     p = BinaryProjection(corrected, Projection.TYPE_HORIZONTAL)
     # p.debug()
     return max(np.gradient(p.get_projection())) + abs(min(np.gradient(p.get_projection())))
Esempio n. 3
0
 def normalize_font(self, angle):
     obj = ShearTool(self.img)
     return obj.shear(angle)
Esempio n. 4
0
 def normalize_font(self, angle):
     obj = ShearTool(self.img)
     return obj.shear(angle)