This chapter has been tested with OpenCV 4.1.1.
Note that you might have to obtain the so-called extra modules from https://github.com/Itseez/opencv_contrib.
We install OpenCV with OPENCV_ENABLE_NONFREE and the OPENCV_EXTRA_MODULES_PATH variable set in order to get Speeded-Up Robust Features (SURF) and the Fast Library for Approximate Nearest Neighbors (FLANN) installed. You can also use the Docker files available in the repository, which contain all the required installations.
Additionally, note that you may have to obtain a license to use SURF in commercial applications.
The code for this chapter can be found in the GitHub book repository available at https://github.com/PacktPublishing/OpenCV-4-with-Python-Blueprints-Second-Edition/tree/master/chapter3.