// returns the mask and frame of contact. int YARPFlowTracker::GetObjectProperties (YARPImageOf<YarpPixelMono>& mask, YARPImageOf<YarpPixelBGR>& frame) { // contact_frame mask.CastCopy (segmentation_mask_copy); frame.CastCopy (seq->GetImageRef(contact_frame)); return 0; }
void Filter(YARPImageOf<YarpPixelBGR>& src, YARPImageOf<YarpPixelBGR>& dest) { FiveBoxesInARow& boxes = out_data.Content(); YARPImageOf<YarpPixelMono> mono; mono.CastCopy(src); dest.PeerCopy(src); trackers.Update(mono,dest,boxes); out_data.Write(); /* static ImgTrackTool track; dest.PeerCopy(src); track.Apply(dest); */ }
int YARPImageFile::Write(const char *dest, YARPGenericImage& src, int format) { if (format!=YARPImageFile::FORMAT_NUMERIC) { return ImageWrite(src,dest); } YARPImageOf<YarpPixelFloat> flt; ofstream fout(dest); flt.CastCopy(src); for (int i=0; i<flt.GetHeight(); i++) { for (int j=0; j<flt.GetWidth(); j++) { char buf[255]; sprintf(buf,"%g ", flt(j,i)); fout << buf << " "; } fout << endl; } return 0; //return ImageWrite(src,dest); //return 0; }