1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
IplImage** AllCov = ArrCov(img, patch_size,window, Gab0,Gab85,Gab180,Gab265 );
ofstream outdata; // outdata is like cin
outdata.open("testgraph.txt"); // opens the file
if( !outdata ) { // file couldn't be opened
cerr << "Error: file could not be opened" << endl;
exit(1);
}
CvMat* EigenV = cvCreateMat(25,12,CV_32FC1);
for (int Ch= 0; Ch<25;Ch++){
CvMat* E = cvCreateMat(12,12,CV_32FC1);
CvMat* l = cvCreateMat(12,1,CV_32FC1);
cvEigenVV(AllCov[Ch], E, l);
cout<<cvmGet(l,0,0)<<endl;
outdata << cvmGet(l,0,0)<<endl;
cout<<cvmGet(l,1,0)<<endl;
outdata << cvmGet(l,1,0)<<endl;
cout<<cvmGet(l,2,0)<<endl;
outdata << cvmGet(l,2,0)<<endl;
cout<<cvmGet(l,3,0)<<endl;
outdata << cvmGet(l,3,0)<<endl;
cout<<cvmGet(l,4,0)<<endl;
outdata << cvmGet(l,4,0)<<endl;
cout<<cvmGet(l,5,0)<<endl;
outdata << cvmGet(l,5,0)<<endl;
cout<<cvmGet(l,6,0)<<endl;
outdata << cvmGet(l,6,0)<<endl;
cout<<cvmGet(l,7,0)<<endl;
outdata << cvmGet(l,7,0)<<endl;
cout<<cvmGet(l,8,0)<<endl;
outdata << cvmGet(l,8,0)<<endl;
cout<<cvmGet(l,9,0)<<endl;
outdata << cvmGet(l,9,0)<<endl;
cout<<cvmGet(l,10,0)<<endl;
outdata << cvmGet(l,10,0)<<endl;
cout<<cvmGet(l,11,0)<<endl;
outdata << cvmGet(l,11,0)<<endl;
}
|