
    9i                     P    S /r SSKrS\R                  S\R                  S\4S jrg)get_neighbor_boxes_idx    N	src_boxesref_boxreturnc                    / n[        U 5      S:  a  [        R                  " US   U SS2S4   5      n[        R                  " US   U SS2S4   5      n[        R                  " US   U SS2S4   5      n[        R                  " US   U SS2S4   5      nXS-
  nXd-
  n[        R                  " US:  US:  -  US:  -  5      S   n	UR                  U	5        U$ )a  
Retrieve indices of source boxes that are neighbors to the reference box.

Parameters:
src_boxes (np.ndarray): An array of bounding boxes with shape (N, 4),
                        where N is the number of boxes and each box is represented
                        by [x1, y1, x2, y2].
ref_box (np.ndarray): A single bounding box represented by [x1, y1, x2, y2].

Returns:
list: A list of indices of the source boxes that are close to the
      reference box based on the intersection area.
r   N         i)lennpmaximumminimumwhereextend)
r   r   match_idx_listx1y1x2y2pub_wpub_h	match_idxs
             s/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/table_recognition/utils.pyr   r      s     N
9~ZZ
IadO4ZZ
IadO4ZZ
IadO4ZZ
IadO4HHeaiEAI6%#+FGJ	i(    )__all__numpyr   ndarraylistr    r   r   <module>r       s4    $
$ bjj 2:: $ r   