U
    ?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rltt|  \}}tdt	fdt	fdt	fdt	fdt	|ffg}nPd	}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rt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scaleZorientationdataSURF   Zsecond_moment   sign )sepzInvalid z feature file.)
isinstancestropenmapintreadlinesplitnpZdtypefloatfromfilesizeitemsizeOSErrorcloseview)ZfilelikemodefZfilelike_is_strZnr_featuresZfeature_lendatatyper    r!   A/var/www/html/venv/lib/python3.8/site-packages/skimage/io/sift.py
_sift_read   s4    #
 

 
r#   c                 C   s   t | ddS )Nr   r   r#   r   r!   r!   r"   r   H   s    c                 C   s   t | ddS )Nr	   r$   r%   r&   r!   r!   r"   r   L   s    )r   )numpyr   __all__r#   r   r   __doc__r!   r!   r!   r"   <module>   s   
B