def _process(self, segments):
        mlh, mlw = self.max_line_height, self.max_line_width
        s = segments.astype(numpy.uint32)
        order = mlw * (s[:, 1] // mlh) + s[:, 0]
        sort_order = numpy.argsort(order)
        return segments[sort_order]