code: def filterVerticalLines(arr, min_line_length=4):
      
      gy = arr.shape[0]
      gx = arr.shape[1]
      mn = min_line_length-1
      for i in range(gy):
          for j in range(gx):
              if arr[i,j]:
                  for d in range(min_line_length):
                      if not arr[i+d,j]:
                          break
                  if d == mn:
                      d = 0
                      while True:
                          if not arr[i+d,j]:
                              break
                          arr[i+d,j] = 0
                          d +=1
docs: Remove vertical lines in boolean array if linelength >=min_line_length