private void Update(Photo photo) { var inputImages = new List <Image <Gray, byte> >(); var labelsList = new List <int>(); MemoryStream str = new MemoryStream(photo.Face.Image); Bitmap b = new Bitmap(Image.FromStream(str)); Image <Gray, byte> img = new Image <Gray, byte>(b); img._EqualizeHist(); inputImages.Add(img); labelsList.Add(photo.OwnerId); DataPath = Server.MapPath("~/App_Data/Faces"); FaceRecognizer.Update(inputImages.ToArray(), labelsList.ToArray()); FaceRecognizer.Save(DataPath); }
public void update_single(Image <Gray, byte> face, int label) { face_recognizer.Update(IEnumerableExt.FromSingleItem(face).ToArray(), IEnumerableExt.FromSingleItem(label).ToArray()); }