Esempio n. 1
0
 public ColoredIterativePointMatching(Frame frame, List <LocalCoordinateMapper> localCoordinateMappers, IList <CvMat> initialModelTransforms, Func <float, double> weightFromDistanceSq, double colorScale)
 {
     if (weightFromDistanceSq == null)
     {
         throw new ArgumentNullException("weightFromDistanceSq");
     }
     for (int i = 0; i < frame.recordNum; i++)
     {
         List <Tuple <CvPoint3D64f, CvColor> > modelPoints = localCoordinateMappers[i].GetUserColorPoints(frame.DepthMatList[i], frame.ColorMatList[i], frame.UserMatList[i]);
         FlannColoredModelPoints model = new FlannColoredModelPoints(modelPoints, new KDTreeIndexParams(), new SearchParams(), colorScale);
         _flannModels.Add(model);
     }
     if (_flannModels.Count != initialModelTransforms.Count)
     {
         throw new ArgumentException("transform list length must be same as model list length");
     }
     _modelTransforms      = initialModelTransforms.ToList();
     _weightFromDistanceSq = weightFromDistanceSq;
 }
 public ColoredIterativePointMatching(Frame frame, List<LocalCoordinateMapper> localCoordinateMappers, IList<CvMat> initialModelTransforms, Func<float, double> weightFromDistanceSq, double colorScale)
 {
     if (weightFromDistanceSq == null)
     {
         throw new ArgumentNullException("weightFromDistanceSq");
     }
     for (int i = 0; i < frame.recordNum; i++)
     {
         List<Tuple<CvPoint3D64f, CvColor>> modelPoints = localCoordinateMappers[i].GetUserColorPoints(frame.DepthMatList[i], frame.ColorMatList[i], frame.UserMatList[i]);
         FlannColoredModelPoints model = new FlannColoredModelPoints(modelPoints, new KDTreeIndexParams(), new SearchParams(), colorScale);
         _flannModels.Add(model);
     }
     if (_flannModels.Count != initialModelTransforms.Count)
     {
         throw new ArgumentException("transform list length must be same as model list length");
     }
     _modelTransforms = initialModelTransforms.ToList();
     _weightFromDistanceSq = weightFromDistanceSq;
 }