B
    \	                 @   sJ   d dl mZ 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 )    )string_typesN	load_sift	load_surfSIFTc          	   C   s  t | trt| d}d}n| }d}|dkrnt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||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columnZscaleZorientationdataSURF   Zsecond_moment   Zsign )sepzInvalid {} feature file.)
isinstancer   openmapintreadlinesplitnpZdtypefloatZfromfilesizeitemsizeIOErrorformatcloseZview)ZfilelikemodefZfilelike_is_strZnr_featuresZfeature_lenZdatatyper	    r   .lib/python3.7/site-packages/skimage/io/sift.py
_sift_read   s,    #


r    c             C   s   t | ddS )Nr   )r   )r    )r   r   r   r   r   I   s    c             C   s   t | ddS )Nr
   )r   )r    )r   r   r   r   r   M   s    )r   )	Zsixr   Znumpyr   __all__r    r   r   __doc__r   r   r   r   <module>   s   
B