3

I am trying to use sift for object classification using Normal Bayes Classifier.When I compute the descriptors for each image of variable size i get different sized feature vectors. Eg:

Feature Size: [128 x 39]

Feature Size: [128 x 54] 

Feature Size: [128 x 69]

Feature Size: [128 x 64]

Feature Size: [128 x 14]

As for development, i am using 20 training images and therefore i have 20 labels. My classification is only of 3 classes containing car, book and ball. So my label vector size is [1 x 20]

As far as I understand, to perform Machine learning the feature vector size and label vector size should be same so i should get a vector size for training data as [__ x 20] and label is [1 x 20].

But my problem is that sift has 128 dimensional feature space hence and each image has different feature size as i shown above. How do I convert all to same size without losing features? OR perhaps I might be doing it incorrectly so please help me out in this?

PS: actual I have done it using BOW model and it works but just for my learning purposes I am trying to do it in this matter just to learn out of interest so any hint and advise are welcomed. Thank you

rish
  • 5,575
  • 6
  • 22
  • 27

2 Answers2

4

You are right, SIFT descriptor is a 128 dimensional feature.

SIFT descriptor is computed for every key-point detected in the image. Before computing descriptor, you probably used a detector (as Harris, Sift or Surf Detector) to detect points of interest.

Detecting key-points and computing descriptors are two independent steps!

When you print Feature Size: [128 x Y] in your program, Y represents the number of key-points detected in the current image.

Generally, using BOW allows you to assign for each key-points descriptors the indice of the closest cluster in the BOW. Depending on your application, you can make decision ... (voting on the presence of one object in the scene or ...)

Eric
  • 2,301
  • 3
  • 23
  • 30
  • Thank you. Actually I did a assignment and I used BOW and it works well. However i got so interested that I am trying different ways to classify images. I am trying to classify without using BOW model so I am wondering how can i assign training matrix. Do you think I change the matrix from [128 x Y ] to [1 x Y]. This mean I am using only one dimension of the vector. What you think about this? – rish Jul 17 '13 at 09:21
  • 1
    [1 x Y] matrix makes no sense. Actually you can use individual SIFT features [128 x 1] foreach Y and compare them to extracted SIFT from another image. – Eric Jul 17 '13 at 11:19
  • Sorry actually that is what meant.. Thanks alot. – rish Jul 18 '13 at 13:11
0

If you do not want to use BOW you could try to match the individual SIFT features as described in the original SIFT paper by Lowe.

The basic idea is that you compare two images with each other and decide, whether they are similar or not. You do that by comparing the individual SIFT features. You decide if they match. Then, to check if the spatial positions are consistent, you need to check if it is possible to transform the matched features from one image to the other.

It is described in more detail in the SIFT wikipedia article.

sietschie
  • 7,425
  • 3
  • 33
  • 54