o
    h	                     @   s>   d dl ZddgZd	ddZdd Zdd Zeje_eje_dS )
    N	load_sift	load_surfSIFTc              	   C   s  t | trt| }d}n| }d}|dkr6tt|  \}}tdt	fdt	fdt	fdt	fdt	|ffg}n(d	}t| d
 }t| }tdt	fdt	fdt	dffdt	fdt	|ffg}tj
|dd}|j||j tt	j 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 `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	    r(   J/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/io/sift.py
_sift_read   s0   
#


r*   c                 C      t | ddS )Nr   r"   r*   r#   r(   r(   r)   r   H      c                 C   r+   )Nr
   r,   r-   r.   r(   r(   r)   r   L   r/   )r   )numpyr   __all__r*   r   r   __doc__r(   r(   r(   r)   <module>   s    
B