/******************************************************************* * Function Name: Write * Return Type : int * Created On : Feb 11, 2013 * Created By : hrushi * Comments : Writes the features for the given image into the file. * The Image name and the features are taken from the * class member variable map * Arguments : *******************************************************************/ int Features::Write( const Args& args, const int CurrentLabel, const ContourMap& Segments ) { if(bWBanner) { WriteBanner(); bWBanner = false; } WriteFeatures(args,CurrentLabel, Segments); return EXIT_SUCCESS; }
void HarrisBuffer::DetectInterestPoints(int border) { ipList.clear(); Hbuffer.FindLocalMaxima(ipList,true); CvMat *reg=cvCreateMat( SizeNeighb, 1, CV_64F ); //remove border if(border<2) border=2; // interest points in the boundary should be remove to have a valid local 5x5x5 mask // an alternative could be extending by 2 pixel in space dimensions //select significant points which are not in the boundary for(int i=0;i<(int)ipList.size();i++) if(ipList[i].x>=border && (ipList[i].x<frame->width-border) && ipList[i].y>=border && (ipList[i].y<frame->height-border) && ipList[i].val>SignificantPointThresh) ipList[i].reject=false; //computing JET features around an interest point by 5x5x5 local mask for(int i=0;i<(int)ipList.size();i++) if(!ipList[i].reject) { ipList[i].features=cvCreateMat( LengthFeatures, 1, CV_64F ); convbuffer.GetLocalRegion(ipList[i].x,ipList[i].y ,ipList[i].t,5,5,5, reg); cvMatMul(&JetFilter,reg,ipList[i].features); cvMul(ipList[i].features,normvec,ipList[i].features);//normalization } cvReleaseMat(®); //check tstamp for any possible error //writing selected interest points to file for(int i=0;i<(int)ipList.size();i++) if(!ipList[i].reject) WriteFeatures(ipList[i]); }