Add next and previous navigation links to all tutorials
[platform/upstream/opencv.git] / doc / tutorials / features2d / feature_homography / feature_homography.markdown
1 Features2D + Homography to find a known object {#tutorial_feature_homography}
2 ==============================================
3
4 @prev_tutorial{tutorial_feature_flann_matcher}
5 @next_tutorial{tutorial_detection_of_planar_objects}
6
7 Goal
8 ----
9
10 In this tutorial you will learn how to:
11
12 -   Use the function @ref cv::findHomography to find the transform between matched keypoints.
13 -   Use the function @ref cv::perspectiveTransform to map the points.
14
15 \warning You need the <a href="https://github.com/opencv/opencv_contrib">OpenCV contrib modules</a> to be able to use the SURF features
16 (alternatives are ORB, KAZE, ... features).
17
18 Theory
19 ------
20
21 Code
22 ----
23
24 @add_toggle_cpp
25 This tutorial code's is shown lines below. You can also download it from
26 [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/features2D/feature_homography/SURF_FLANN_matching_homography_Demo.cpp)
27 @include samples/cpp/tutorial_code/features2D/feature_homography/SURF_FLANN_matching_homography_Demo.cpp
28 @end_toggle
29
30 @add_toggle_java
31 This tutorial code's is shown lines below. You can also download it from
32 [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/features2D/feature_homography/SURFFLANNMatchingHomographyDemo.java)
33 @include samples/java/tutorial_code/features2D/feature_homography/SURFFLANNMatchingHomographyDemo.java
34 @end_toggle
35
36 @add_toggle_python
37 This tutorial code's is shown lines below. You can also download it from
38 [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/features2D/feature_homography/SURF_FLANN_matching_homography_Demo.py)
39 @include samples/python/tutorial_code/features2D/feature_homography/SURF_FLANN_matching_homography_Demo.py
40 @end_toggle
41
42 Explanation
43 -----------
44
45 Result
46 ------
47
48 -   And here is the result for the detected object (highlighted in green). Note that since the homography is estimated with a RANSAC approach,
49     detected false matches will not impact the homography calculation.
50
51     ![](images/Feature_Homography_Result.jpg)