Closed AbdalaMask closed 1 year ago
plass help
void cv::operator>>
using var fs = new FileStorage("pca_data", FileStorage.Modes.Read))
using var eigenvectors = fs["e_vectors"]?.ReadMat();
...
thank you for replying
I used FileStorage fs1 = new FileStorage("LicensePlate/pca_data.yml", FileStorage.Modes.Read);
pca_test.Read(fs1.Root());
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
how using Introduction to Principal Component Analysis (PCA)
void Get_Featurevector_Using_PCA(Mat sample,vector &Featur_Vector)
{ PCA pca_test; Mat reshaped; Mat result_image; / this part to extract data from pca file/ //to read pca data from xml file to use it to project feature vector FileStorage fs1("pca_data",FileStorage::READ); fs1["mean"] >> pca_test.mean ; //cout<<pca_test.mean<<endl; fs1["e_vectors"] >> pca_test.eigenvectors ; fs1["e_values"] >> pca_test.eigenvalues ; fs1.release(); int size=sample.rowssample.cols; /to convert matrix to vector/ reshaped=sample; reshaped=sample.reshape(1,size); reshaped.convertTo(reshaped,CV_32FC1,1/255.);//convert to float data type to deal with pca /end conversion*/ pca_test.project(reshaped,result_image); Featur_Vector=result_image;
} how convert to c# plsssss