MikkoLipsanen commited on
Commit
df90883
·
verified ·
1 Parent(s): 37b60ea

Update onnx_text_recognition.py

Browse files
Files changed (1) hide show
  1. onnx_text_recognition.py +1 -2
onnx_text_recognition.py CHANGED
@@ -43,8 +43,7 @@ class TextRecognition:
43
  def crop_line(self, image, polygon, height, width):
44
  """Crops predicted text line based on the polygon coordinates
45
  and returns binarised text line image."""
46
- poly = np.array([[int(lst[0]), int(lst[1])] for lst in polygon])
47
-
48
  rect = cv2.boundingRect(polygon)
49
  cropped_image = image[rect[1]: rect[1] + rect[3], rect[0]: rect[0] + rect[2]]
50
  mask = np.zeros([rect[3], rect[2]], dtype=np.uint8)
 
43
  def crop_line(self, image, polygon, height, width):
44
  """Crops predicted text line based on the polygon coordinates
45
  and returns binarised text line image."""
46
+ poly = np.array([[int(lst[0]), int(lst[1])] for lst in polygon], dtype=np.int32)
 
47
  rect = cv2.boundingRect(polygon)
48
  cropped_image = image[rect[1]: rect[1] + rect[3], rect[0]: rect[0] + rect[2]]
49
  mask = np.zeros([rect[3], rect[2]], dtype=np.uint8)