
    1-Ph
                     Z    d dl ZddgZddZd Zd Zej        e_        ej        e_        dS )	    N	load_sift	load_surfSIFTc           	      t   t          | t                    rt          |           }d}n| }d}|dk    r{t          t          |                                                                          \  }}t          j        dt          fdt          fdt          fdt          fdt          |ffg          }nd	}t	          |                                          d
z
  }t	          |                                          }t          j        dt          fdt          fdt          dffdt          fdt          |ffg          }t          j
        |d          }|j        ||j        z  t          j        t                    j        z  k    rt          d| d          |r|                                 |                    |          S )a   Read SIFT or SURF features from externally generated file.

    This routine reads SIFT or SURF files generated by binary utilities from
    http://people.cs.ubc.ca/~lowe/keypoints/ and
    http://www.vision.ee.ethz.ch/~surf/.

    This routine *does not* generate SIFT/SURF features from an image. These
    algorithms are patent encumbered. Please use :obj:`skimage.feature.CENSURE`
    instead.

    Parameters
    ----------
    filelike : string or open file
        Input file generated by the feature detectors from
        http://people.cs.ubc.ca/~lowe/keypoints/ or
        http://www.vision.ee.ethz.ch/~surf/ .
    mode : {'SIFT', 'SURF'}, optional
        Kind of descriptor used to generate `filelike`.

    Returns
    -------
    data : record array with fields
        - row: int
            row position of feature
        - column: int
            column position of feature
        - scale: float
            feature scale
        - orientation: float
            feature orientation
        - data: array
            feature values

    TFr   rowcolumnscaleorientationdataSURF   second_moment   sign )sepzInvalid z feature file.)
isinstancestropenmapintreadlinesplitnpdtypefloatfromfilesizeitemsizeOSErrorcloseview)filelikemodeffilelike_is_strnr_featuresfeature_lendatatyper   s           O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/io/sift.py
_sift_readr+      s   F (C    NNv~~#&sAJJLL,>,>,@,@#A#A [85!% &%-.
 
 !**,,''!+!**,,''85! 5!*-%-.
 
 ;qc"""DyK("33bhuoo6NNNN5555666  				99X    c                 $    t          | d          S )Nr   r$   r+   r%   s    r*   r   r   T       af%%%%r,   c                 $    t          | d          S )Nr   r.   r/   r0   s    r*   r   r   X   r1   r,   )r   )numpyr   __all__r+   r   r   __doc__ r,   r*   <module>r7      sp       
$K K K K\& & && & & &	 &	   r,   