o
    :ήc	                     @   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}d}n| }d}|dkr7t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

    rTFr   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IOErrorcloseview)filelikemodeffilelike_is_strnr_featuresfeature_lendatatyper
    r)   6/tmp/pip-target-vg8gfxp4/lib/python/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   r0   )r   )numpyr   __all__r+   r   r   __doc__r)   r)   r)   r*   <module>   s    
B