zoukankan      html  css  js  c++  java
  • PCA之后进行归一化

    不过还是有问题,正在慢慢分析原因吧。

    #include <cv.h>
    #include <cxcore.h>
    #include <highgui.h>
    #include <fstream>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    
    int main()
    {
    	ifstream myfile( "E:\\feature_size.txt ");
    	if (!myfile.is_open())
    		cout << "Unable to open file";
    	int rows = 0,cols = 20;
    	myfile >> rows ;
    	//ifstream feature_file( "E:\\features.txt ");
    	CvMat *fc = cvCreateMat(rows,cols,CV_32FC1);
    	CvMat *dst = cvCreateMat(rows,cols,CV_32FC1);
    	ifstream fin("E:\\feature_pca.txt ",std::ifstream::in);
    	for(int i = 0;i < rows; ++i)
    		for(int j = 0;j < cols; ++j)
    		{
    			fin >> fc->data.fl[i*cols+j];
    		}        
    		fin.close();
        cvNormalize(fc,dst,1,0,CV_C,NULL);
    	ofstream file( "E:\\feature_guiyihua.txt ");
    	for (int i = 0; i < dst->rows;++i)
    	{
    		for(int j = 0;j < dst->cols; ++j)
    		{
    			file << cvmGet(dst,i,j) << " ";
    		}
    		file << "\n";
    	}
    }
    

      

  • 相关阅读:
    WEB UI 整理
    RAT
    client 控制
    SiMay 远控
    SSH/SOCKS成为全局代理
    BypassAntiVirus
    QuasarRAT 使用
    从 Qt 的 delete 说开来
    Spectrum Analyzer test.cpp Example File
    windows下C/C++的内存泄露检测
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/2216904.html
Copyright © 2011-2022 走看看