Skip to content

Commit

Permalink
SIFT+SURF PyDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
abidrahmank committed Jul 11, 2013
1 parent 5d863f7 commit 031c77f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/nonfree/doc/feature_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The SIFT constructors.

.. ocv:function:: SIFT::SIFT( int nfeatures=0, int nOctaveLayers=3, double contrastThreshold=0.04, double edgeThreshold=10, double sigma=1.6)
.. ocv:pyfunction:: cv2.SIFT([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma]]]]]) -> <SIFT object>
:param nfeatures: The number of best features to retain. The features are ranked by their scores (measured in SIFT algorithm as the local contrast)

:param nOctaveLayers: The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution.
Expand All @@ -33,6 +35,12 @@ Extract features and computes their descriptors using SIFT algorithm

.. ocv:function:: void SIFT::operator()(InputArray img, InputArray mask, vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
.. ocv:pyfunction:: cv2.SIFT.detect(image[, mask]) -> keypoints
.. ocv:pyfunction:: cv2.SIFT.compute(image, keypoints[, descriptors]) -> keypoints, descriptors
.. ocv:pyfunction:: cv2.SIFT.detectAndCompute(image, mask[, descriptors[, useProvidedKeypoints]]) -> keypoints, descriptors
:param img: Input 8-bit grayscale image

:param mask: Optional input mask that marks the regions where we should detect features.
Expand All @@ -43,6 +51,7 @@ Extract features and computes their descriptors using SIFT algorithm

:param useProvidedKeypoints: Boolean flag. If it is true, the keypoint detector is not run. Instead, the provided vector of keypoints is used and the algorithm just computes their descriptors.

.. note:: Python API provides three functions. First one finds keypoints only. Second function computes the descriptors based on the keypoints we provide. Third function detects the keypoints and computes their descriptors. If you want both keypoints and descriptors, directly use third function as ``kp, des = cv2.SIFT.detectAndCompute(image, None)``

SURF
----
Expand Down Expand Up @@ -105,6 +114,8 @@ Detects keypoints and computes SURF descriptors for them.
.. ocv:function:: void SURF::operator()(InputArray img, InputArray mask, vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
.. ocv:pyfunction:: cv2.SURF.detect(image[, mask]) -> keypoints
.. ocv:pyfunction:: cv2.SURF.compute(image, keypoints[, descriptors]) -> keypoints, descriptors
.. ocv:pyfunction:: cv2.SURF.detectAndCompute(image, mask[, descriptors[, useProvidedKeypoints]]) -> keypoints, descriptors
.. ocv:cfunction:: void cvExtractSURF( const CvArr* image, const CvArr* mask, CvSeq** keypoints, CvSeq** descriptors, CvMemStorage* storage, CvSURFParams params )
Expand Down Expand Up @@ -325,4 +336,4 @@ The ``descriptors`` matrix is :math:`\texttt{nFeatures} \times \texttt{descripto

The class ``SURF_OCL`` uses some buffers and provides access to it. All buffers can be safely released between function calls.

.. seealso:: :ocv:class:`SURF`
.. seealso:: :ocv:class:`SURF`

0 comments on commit 031c77f

Please sign in to comment.