필터 지우기
필터 지우기

How to use VLfeat to do VLAD-k encoding?

조회 수: 3 (최근 30일)
Yi Zhu
Yi Zhu 2016년 5월 28일
답변: ahmed shahin 2021년 8월 20일
Hi everyone, I want to use VLfeat library to do VLAD-k encoding of image features. They have a simple tutorial online at here (<http://www.vlfeat.org/overview/encodings.html)>. But the tutorial is a little vague for me to follow. In addition, the example is for VLAD with nearest neighbor, not VLAD-k. So could anyone write an example of VLAD-k using VLfeat for me? Thanks a lot.
  댓글 수: 1
Yi Zhu
Yi Zhu 2016년 5월 28일
VLAD-k exmaple I wrote, is this correct? Especially for the assignment step? Thanks.
numFeatures = 5000 ;
dimension = 2 ;
data = rand(dimension,numFeatures) ; % Data is used to train the VLAD encoding
numDataToBeEncoded = 1000;
dataToBeEncoded = rand(dimension,numDataToBeEncoded);
numClusters = 30 ;
centers = vl_kmeans(data, numClusters);
kdtree = vl_kdtreebuild(centers) ;
nn = vl_kdtreequery(kdtree, centers, dataToBeEncoded,'NUMNEIGHBORS', k) ; % k is the number of nearest neighbors
assignments = zeros(numClusters,numDataToBeEncoded);
assignments(sub2ind(size(assignments), nn, 1:length(nn))) = 1; % is here still correct for VLAD-k? nn is a matrix now
enc = vl_vlad(dataToBeEncoded,centers,assignments);

댓글을 달려면 로그인하십시오.

답변 (1개)

ahmed shahin
ahmed shahin 2021년 8월 20일
Dear Zhu
what is the value of k?

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by