Hi everybody,
I'm attempting to classify 10 classes of hand pictures using a specific feature space. Training data is converted to a Mat object containing 240 rows (number of training pictures) and 480 cols (number of features) normalized between 0 and 1. The type of training data mat is CV_64FC1. I'm going to pass this matrix to PCA in order to extract useful features. After that I want to pass PCA result to SVM in order to train a classifier.
The PCA object returns all -NaN and Inf after creating the object:
PCA pca(training_data_mat, Mat(), CV_PCA_DATA_AS_ROW);
training_data_mat
is the matrix of the training data with 240 rows and 450 cols for 240 training images and 450 features. It is created in the following line:
training_data_mat.push_back(extract_features_mat(descriptor,hog_ders)) ;
the extract_features_mat
function is written such that returns a 1 row Mat of type CV_64FC1 containing features of the image. The following line is return value of the extract_features_mat
function:
return Mat (1,feature_size, CV_64FC1, feature_value) ;
and feature_value
is a double array defined and filled in this function.
I'm totally confused what is wrong!