Training of SVM classifier using SIFT features

前端 未结 3 1813
谎友^
谎友^ 2020-12-18 11:09

please i like to classify a set of image in 4 class with SIFT DESCRIPTOR and SVM. Now, using SIFT extractor I get keypoints of different sizes exemple img1 have 100 keypoin

相关标签:
3条回答
  • 2020-12-18 11:47

    You will always get different number of keypoints for different images, but the size of feature vector of each descriptor point remains same i.e. 128. People prefer using Vector Quantization or K-Mean Clustering and build Bag-of-Words model histogram. You can have a look at this thread.

    0 讨论(0)
  • 2020-12-18 11:53

    In this case, perhaps dense sift is a good choice.

    There are two main stages:

    Stage 1: Creating a codebook.

    1. Divide the input image into a set of sub-images.
    2. Apply sift on each sub-image. Each key point will have 128 dimensional feature vector.
    3. Encode these vectors to create a codebook by simply applying k-means clustering with a chosen k. Each image will produce a matrix Vi (i <= n and n is the number of images used to create the codeword.) of size 128 * m, where m is the number of key points gathered from the image. The input to K-means is therefore, a big matrix V created by horizontal concatenation of Vi, for all i. The output of K-means is a matrix C with size 128 * k.

    Stage 2: Calculating Histograms.

    For each image in the dataset, do the following:

    1. Create a histogram vector h of size k and initialize it to zeros.
    2. Apply dense sift as in step 2 in stage 1.
    3. For each key point's vector find the index of it's "best match" vector in the codebook matrix C (can be the minimum in the Euclidian distance) .
    4. Increase the corresponding bin to this index in h by 1.
    5. Normalize h by L1 or L2 norms.

    Now h is ready for classification.

    Another possibility is to use Fisher's vector instead of a codebook, https://hal.inria.fr/file/index/docid/633013/filename/jegou_aggregate.pdf

    0 讨论(0)
  • 2020-12-18 11:54

    Using the conventional SIFT approach you will never have the same number of key points in every image. One way of achieving that is to sample the descriptors densely, using Dense SIFT, that places a regular grid on top of the image. If all images have the same size, then you will have the same number of key points per image.

    0 讨论(0)
提交回复
热议问题