void save(const string file_name, cv::PCA &pca_)
{
cv::FileStorage fs(file_name, cv::FileStorage::WRITE);
fs << "mean" << pca_.mean;
fs << "e_vectors" << pca_.eigenvectors;
fs << "e_values" << pca_.eigenvalues;
fs.release();
}
void load(const string file_name,cv::PCA &pca_)
{
cv::FileStorage fs(file_name,cv::FileStorage::READ);
fs["mean"] >> pca_.mean ;
fs["e_vectors"] >> pca_.eigenvectors ;
fs["e_values"] >> pca_.eigenvalues ;
fs.release();
}
댓글 없음:
댓글 쓰기