コード例 #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())))
コード例 #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())))
コード例 #3
0
 def normalize_font(self, angle):
     obj = ShearTool(self.img)
     return obj.shear(angle)
コード例 #4
0
 def normalize_font(self, angle):
     obj = ShearTool(self.img)
     return obj.shear(angle)