Ask Your Question
0

DenseFeatureDetector: Only a certain number of points?

asked 2015-04-13 09:14:19 -0600

Poyan gravatar image

I'm using DenseFeatureDetector and want to return only a certain number of keypoints (or as close to that amount as possible). I know I can tweak the parameters listed in the documentation (http://docs.opencv.org/modules/featur...) and try to calculate how many keypoints will be generated, but I was wondering if there's a simpler way.

With the other feature detectors (SIFT, FAST etc) I can sort based on the response and only save the n best features. Since the DenseFeatureDetector only lays out the keypoints in a gridlike fashion, the points don't have a "response" value AFAIK.

I could just take the first n features, but that would probably only cover the first portion of the page. Better would be to save every k keypoint so that it is still in a gridlike fashion but just more sparsely laid out.

tl; dr: What's the best way to return only n features when using DenseFeatureDetector?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-04-13 09:51:08 -0600

Guanta gravatar image

Some things which come to my mind:

  • The easiest way is just to sample as you like, e.g. sample only every 10th point.

  • As you correctly pointed out, the response won't get associated and you can't get the mass (= the response) back from the descriptor since it is typically already l2-normalized. Thus, doing this implies that you modify the code such that it doesn't get normalized then you can compute the 'strength' of a descriptor by computing its l1-norm (= mass = response).

  • If you don't want to modify the code you could compute the 'strength' of a keypoint afterwards, e.g. by computing the entropy of the surrounding patch.

  • When you want to use the dense-descriptors for classification, you can make use of local pooling, e.g. for bag-of-words you can make use of max-pooling.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-04-13 09:14:19 -0600

Seen: 221 times

Last updated: Apr 13 '15