Ask Your Question

rannock's profile - activity

2018-09-18 01:37:00 -0600 received badge  Famous Question (source)
2016-10-17 08:43:21 -0600 received badge  Notable Question (source)
2014-12-08 17:07:59 -0600 received badge  Popular Question (source)
2014-04-03 07:02:33 -0600 received badge  Student (source)
2012-10-09 03:28:18 -0600 received badge  Supporter (source)
2012-10-08 18:28:11 -0600 received badge  Editor (source)
2012-10-08 18:26:22 -0600 commented question Training of SVM classifier in OpenCV using HOG, SIFT and ORB features

Are you sure? For the HOG features I used a cv::Mat in wich I put in the descriptors (in each row the descriptor of one image); so I thought I could do the same with the SIFT: I build (for every image) a vector in wich I put in the descriptors (calculated with the keypoint). Then I push back every vector in a cv::Mat that I use for the training. if, as you say, it doesn't work, can you recommend a better method? thank you very much!

2012-10-08 07:42:32 -0600 asked a question Training of SVM classifier in OpenCV using HOG, SIFT and ORB features

I'm trying to train a SVM classifier to recognize pedestrians in a set of 64x128 images. I've already done that using HOG features, and now I need to implement the same thing using SIFT and ORB. Now I have a problem: I can not extract the SIFT features from images, nay, I extract the features but I found out that most of desriptors have a 0 value.

This is a piece of the code:

DenseFeatureDetector detector;
SiftDescriptorExtractor descriptor;
vector<KeyPoint> keypoints;


//for every image I compute te SIFT
detector.detect(image, keypoints);
Mat desc;
descriptor.compute(image,keypoints, desc);
Mat v(1,30976,CV_32FC1);
    for (int j = 0; j<desc.rows; j++){
        for(int k = 0; k<desc.cols; k++){
            v.at<float>(0,128*j+k) = desc.at<float>(j,k);

        }
    } //now in vector v there are all the descriptors (the problem is that most of them have 0 value)

descriptormat.push_back(v);  //descriptormat is the cv::Mat that I use to train the SVM

Can anyone help me understand how to solve this problem? Many thanks for your help!