1 Features2D + Homography to find a known object {#tutorial_feature_homography}
2 ==============================================
4 @prev_tutorial{tutorial_feature_flann_matcher}
5 @next_tutorial{tutorial_detection_of_planar_objects}
10 In this tutorial you will learn how to:
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.
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).
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
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
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
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.
51 ![](images/Feature_Homography_Result.jpg)