Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Core::Trec::PrintConceptVector ( std::string  fileName,
int  frameNr,
Matrix::VecScalarInt32 *  histo,
int  numPix 
)

Definition at line 126 of file Concept.h.

References Impala::Core::Matrix::VecE(), and Impala::Core::Matrix::VecNrElem().

00128 {
00129         FILE *file;
00130         if (! (file = fopen(fileName.c_str(), "a"))) {
00131                 std::cout << "PrintConceptVector: error append to file " << fileName
00132                   << std::endl;
00133                 return;
00134         }
00135         
00136         // print sparse SVM format
00137         int n = Matrix::VecNrElem(histo);
00138         int* hPtr = Matrix::VecE(histo, 0);
00139         double eps = 0.0001;
00140         fprintf(file, "%d", frameNr);
00141         for (int i=0 ; i<n ; i++)
00142     {
00143                 double sz = (double) hPtr[i] / numPix;
00144                 if (sz > eps)
00145                         fprintf(file, " %d:%f", i+1, sz);
00146         }
00147         fprintf(file, "\n");
00148 
00149         fclose(file);
00150 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:25:11 2010 for ImpalaSrc by  doxygen 1.5.1