简体   繁体   中英

SIFT descriptors dimension

I want to know, if I can change the SIFT descriptors dimension, if so how can I do it. I know currently the dimension is 128, can we make is 128*4 or 124/4 something like this?

Update: I tried to change the SIFT_DESCR_WIDTH to 2, from 4 in opencv / modules / nonfree / src / sift.cpp, but it doesn't change the dimension of descriptors, when I print descriptors.size() it prints 128.

Regards,

You cannot change SIFT dimensions in OpenCV without changing the OpenCV source. So you have to change sources and recompile whole OpenCV or nonfree module.

Change that constant value, then do cmake & make for OpenCV.

PS Actually, it wouldn`t change a lot for you - check original SIFT paper , figure 8.

您可以尝试SURF描述符,它支持64维,并且计算速度比SIFT快。

You can use PCA (Principle Component Analysis) to try and go from 128 dimensions to 64 dimensions (or any dimensions you choose) after your descriptors have been extracted from your image. You're using C++, but I use Python for my OpenCV work and use sklearn.decomposition for this (I'm sure you can look up a similar library for C++). Basically it's similar to compression. Of course, you will lose some accuracy.

See https://en.wikipedia.org/wiki/Principal_component_analysis

Of course, any image you test against your data set will also need to have PCA run against it's descriptor vectors with the same dimension settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM