Dimensionality reduction in HOG feature vector

2019-05-26 22:16发布

I found out the HOG feature vector of the following image in MATLAB.

Input Image

I used the following code.

I = imread('input.jpg');
I = rgb2gray(I);
[features, visualization] = extractHOGFeatures(I,'CellSize',[16 16]);  

features comes out to be a 1x1944 vector and I need to reduce the dimensionality of this vector (say to 1x100), what method should I employ for the same?

I thought of Principal Component Analysis and ran the following in MATLAB.

prinvec = pca(features);  

prinvec comes out to be an empty matrix (1944x0). Am I doing it wrong? If not PCA, what other methods can I use to reduce the dimension?

1条回答
何必那么认真
2楼-- · 2019-05-26 23:08

You can't do PCA on this, since you have more features than your single observation. Get more observations, some 10,000 presumably, and you can do PCA.

See PCA in matlab selecting top n components for the more detailed and mathematical explanation as to why this is the case.

查看更多
登录 后发表回答