G. Schiele
G. Schiele

Reputation: 103

Extracting information from OpenCV descriptors

Let's say I calculate the keypoints and descriptors of a given image, for example with the ORB algorithm.

import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt

img = cv.imread('simple.jpg',0)

orb = cv.ORB_create()
kp = orb.detect(img,None)
kp, des = orb.compute(img, kp)

How can I extract the properties of these descriptors in order to study them?

Upvotes: 0

Views: 389

Answers (1)

Paul92
Paul92

Reputation: 9062

The keypoints are a list of objects of type Keypoint, which comes from C++. You can access its public attributes as kp[0].pt, for the 2D position of the keypoint, for example. You can find the list of public attributes in the documentation.

The descriptors, on the other hand, are just a list of lists, each with 32 elements.

Upvotes: 1

Related Questions