def METHOD_NAME(self, image: np.ndarray, old_w: int, old_h: int, textlines: List[Quadrilateral], raw_mask, mask):
    new_h, new_w = image.shape[:2]
    raw_mask = cv2.resize(raw_mask, (new_w, new_h), interpolation=cv2.INTER_LINEAR)
    raw_mask = raw_mask[:old_h, :old_w]
    if mask is not None:
        mask = cv2.resize(mask, (new_w, new_h), interpolation=cv2.INTER_LINEAR)
        mask = mask[:old_h, :old_w]
    # Filter out regions within the border and clamp the points of the remaining regions
    new_textlines = []
    for txtln in textlines:
        if txtln.xyxy[0] >= old_w and txtln.xyxy[1] >= old_h:
            continue
        points = txtln.pts
        points[:,0] = np.clip(points[:,0], 0, old_w)
        points[:,1] = np.clip(points[:,1], 0, old_h)
        new_txtln = Quadrilateral(points, txtln.text, txtln.prob)
        new_textlines.append(new_txtln)
    return new_textlines, raw_mask, mask