back soft

مطالب مرتبط با «using pcl and opencv together» در back soft | نویسنده: استخدام کار

Using Opencv to perform PCA analysis in C++

Vote count: 0 I haven't found a working example of implementing PCA analysis using Opencv that suits my case, so I'm not sure what is wrong with my implementation, which follows: void PreProcessor::performPca() { const int type = CV_64F; cv::Mat pt_mat = cv::Mat::zeros(numPatients, numFeatures, type); for (int y = 0; y < numPatients; y++) { for (int x = 0; x < numFeatures; x++) { pt_mat.at(y,x) = features[y].at(x); } } cv::PCA pt_pca(pt_mat, cv::Mat(), CV_PCA_DATA_AS_ROW, numFeatures); cv::Mat dataprojected(pt_mat.rows, numFeatures, pt_mat.type()); for (int i = 0; i < pt_mat.rows; i++) { dataprojected.row(i) = pt_pca.project(pt_mat.row(i)); } features.clear(); for (int i =0; i< dataprojected...

ادامه مطلب