Ask Your Question

Gabriel Cachia's profile - activity

2015-05-12 10:31:45 -0600 asked a question Opencv PCA Saving

I am trying to save my PCA eigenvectors and mean for later projection (to predict values using a SVM), but the dimensions are huge and thus saving and loading of the PCA takes a long time. Is there an alternative to this?

Thank you!

2015-05-09 07:41:18 -0600 received badge  Enthusiast
2015-05-06 16:42:22 -0600 commented question SVM Prediction

Hi, thanks for your suggestion! I used train_auto and the results are really off, the results being produced are different for each image so that is a step forward :). Thanks once again

2015-05-05 08:20:05 -0600 commented question SVM Prediction

Question Edited :) in the do while loop i am grabbing the images in the training set and extracting the Feature Vectors one by one and then adding them to the Feature Vector I am using to train the SVM. Thank you for reading my question!

2015-05-05 08:18:33 -0600 received badge  Editor (source)
2015-05-05 06:26:56 -0600 commented question SVM Prediction

Changing the C parameter multiple times did nothing for the prediction. The result is always 18. I don't know what to do any more since I tried multiple solutions.

2015-05-04 15:22:24 -0600 asked a question SVM Prediction

Hello, this is my first time posting here. I am currently working on age estimation and extracting features using Gabor Filters. I have decided to classify ages using a SVM, the training is successful and it does not take a long time since the feature vectors are only about 3000 in dimensions by a 1000 training samples.

The problem is that when I want to predict an image, the result returned is always 18 (I pass the feature vector of the testing image to the predict function of the SVM). But when I predict an age from the training set the result is always correct. I do not know why this is happening. Any help will be appreciated.

  do {
    sprintf(fullImagePath,"%s\\%s", imageDirectory, c_file.name);
    string label = c_file.name;
    float labelSubstring = atof(label.substr(15,2).c_str());
    labels.push_back(labelSubstring);

    Mat input = imread(fullImagePath,0);
    featureVector = ExtractFeatures(input);
    allFeatureVectors.push_back(featureVector.clone());
} while( _findnext( hFile, &c_file ) == 0 );

SVM svm;
CvSVMParams params;

params.svm_type = CvSVM::C_SVC;
params.kernel_type = CvSVM::RBF;
params.gamma=0.000308;
params.C=1000;
svm.train(allFeatureVectors,labels,Mat(),Mat(),params);

Mat testingSVMBud = imread ("C:\\Users\\Gabriel\\Desktop\\ae2.JPG",0);
Mat fV = ExtractFeatures(testingSVMBud).clone();
float prediction = svm.predict(fV);

Thank you for your time!