bb2658633bdf2ad5af1642987a45c7c7f1135da9
[platform/upstream/opencv.git] / doc / tutorials / features2d / feature_detection / feature_detection.markdown
1 Feature Detection {#tutorial_feature_detection}
2 =================
3
4 Goal
5 ----
6
7 In this tutorial you will learn how to:
8
9 -   Use the @ref cv::FeatureDetector interface in order to find interest points. Specifically:
10     -   Use the cv::xfeatures2d::SURF and its function cv::xfeatures2d::SURF::detect to perform the
11         detection process
12     -   Use the function @ref cv::drawKeypoints to draw the detected keypoints
13
14 \warning You need the <a href="https://github.com/opencv/opencv_contrib">OpenCV contrib modules</a> to be able to use the SURF features
15 (alternatives are ORB, KAZE, ... features).
16
17 Theory
18 ------
19
20 Code
21 ----
22
23 @add_toggle_cpp
24 This tutorial code's is shown lines below. You can also download it from
25 [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/features2D/feature_detection/SURF_detection_Demo.cpp)
26 @include samples/cpp/tutorial_code/features2D/feature_detection/SURF_detection_Demo.cpp
27 @end_toggle
28
29 @add_toggle_java
30 This tutorial code's is shown lines below. You can also download it from
31 [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/features2D/feature_detection/SURFDetectionDemo.java)
32 @include samples/java/tutorial_code/features2D/feature_detection/SURFDetectionDemo.java
33 @end_toggle
34
35 @add_toggle_python
36 This tutorial code's is shown lines below. You can also download it from
37 [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/features2D/feature_detection/SURF_detection_Demo.py)
38 @include samples/python/tutorial_code/features2D/feature_detection/SURF_detection_Demo.py
39 @end_toggle
40
41 Explanation
42 -----------
43
44 Result
45 ------
46
47 -#  Here is the result of the feature detection applied to the `box.png` image:
48
49     ![](images/Feature_Detection_Result_a.jpg)
50
51 -#  And here is the result for the `box_in_scene.png` image:
52
53     ![](images/Feature_Detection_Result_b.jpg)