官术网_书友最值得收藏!

  • OpenCV 4 with Python Blueprints
  • Dr. Menua Gevorgyan Arsen Mamikonyan Michael Beyeler
  • 253字
  • 2021-06-24 16:50:08

Obtaining feature descriptors with SURF

The process of extracting features from an image with OpenCV using SURF is also a single step. It is done by the compute method of our feature extractor. The latter accepts an image and the keypoints of the image as arguments:

key_query, desc_query = self.f_extractor.compute(img_query, key_query)

Here, desc_query is a NumPY ndarray with shape (num_keypoints, descriptor_size). You can see that each descriptor is a vector in an n-dimensional space (n-length array of numbers). Each vector describes the corresponding key point and provides some meaningful information about our complete image.

Hence, we have completed our feature extraction algorithm that had to provide meaningful information about our image in reduced dimensionality. It's up to the creator of the algorithm to decide what kind of information is contained in the descriptor vector, but at the very least the vectors should be such that they are closer to similar keypoints than for keypoints that appear different. 

Our feature extraction algorithm also has a convenient method to combine the processes of feature detection and descriptor creation:

key_query, desc_query = self.f_extractor.detectAndCompute (img_query, None)

It returns both keypoints and descriptors in a single step and accepts a mask of an area of interest, which, in our case, is the complete image.

As we have extracted our features, the next step is to query and train images that contain similar features, which is accomplished by a feature matching algorithm. So, let's learn about feature matching in the next section.

主站蜘蛛池模板: 屯门区| 马关县| 额敏县| 龙泉市| 内乡县| 郧西县| 泗阳县| 缙云县| 武山县| 永德县| 田阳县| 咸丰县| 土默特左旗| 射阳县| 石家庄市| 庆城县| 仪陇县| 东台市| 武清区| 泸西县| 神池县| 卢湾区| 仁布县| 平邑县| 潼关县| 土默特左旗| 鄢陵县| 千阳县| 方山县| 成都市| 科技| 阳信县| 德令哈市| 郴州市| 思茅市| 昂仁县| 江川县| 扬州市| 内丘县| 多伦县| 仲巴县|