public void Test() { var provider = new Db4oProvider("faces.db4o"); Func<Frame, string> f1 = f => f.Guid.ToString() + ".jpg"; Func<Portrait, string> f2 = p => p.Guid.ToString() + ".jpg"; var repository = new Damany.PortraitCapturer.DAL.Providers.LocalDb4oProvider( @".\"); var frame = new Frame(Data.GetFrame()); var mockCamera = new Damany.Cameras.DirectoryFilesCamera(@"c:\", "*.jpg"); mockCamera.Id = 3; frame.CapturedFrom = mockCamera; repository.SaveFrame(frame); var fromDb = repository.GetFrame(frame.Guid); Assert.AreEqual(fromDb.Guid, frame.Guid); var portrait = new Portrait(Data.GetPortrait()); portrait.FaceBounds = new OpenCvSharp.CvRect(0, 0, 100, 100); portrait.CapturedFrom = mockCamera; repository.SavePortrait(portrait); var portraitFromDb = repository.GetPortrait(portrait.Guid); Assert.AreEqual(portraitFromDb.Guid, portrait.Guid); }
public Portrait Clone() { var clone = new Portrait(this.portraitImage.Clone()); this.CopyPropertiesTo(clone); return clone; }
public Portrait Clone() { var clone = new Portrait(this.portraitImage.Clone()); this.CopyPropertiesTo(clone); return(clone); }
private bool CanProceedToCompare(Portrait portrait) { foreach (var facePreFilter in FacePreFilter) { if (!facePreFilter.CanSatisfy(portrait)) { return(false); } } return(true); }
public void AddFace(Damany.Imaging.Common.Portrait p) { var bmp = p.GetIpl().ToBitmap(); this.facesList.Images.Add(bmp); string text = p.CapturedAt.ToString(); ListViewItem item = new ListViewItem() { Tag = p, Text = text, ImageIndex = this.facesList.Images.Count - 1, }; this.facesListView.Items.Add(item); }
public bool CanSatisfy(Portrait portrait) { return _verifier.IsFrontFace(portrait.GetIpl().GetSub(portrait.FaceBounds)); }
bool IsFace(Portrait portrait) { foreach (var facePostFilter in PostFilters) { if (!facePostFilter.IsFace(portrait)) { return false; } } return true; }
private bool CanProceedToCompare(Portrait portrait) { foreach (var facePreFilter in FacePreFilter) { if (!facePreFilter.CanSatisfy(portrait)) { return false; } } return true; }
public void PublishPortrait(Portrait portrait) { }
public void PublishPortrait(Portrait portrait) { var e = new EventArgs<Portrait>(portrait); this.InvokePortraitFound(e); }
private void ShowBigImage(Portrait portrait) { this.BigImage = portrait.Frame.Clone(); currLicenseCaptureTime.EditValue = portrait.CapturedAt; }
public bool IsFace(Portrait portrait) { return _verifier.IsFace(portrait.GetIpl().GetSub(portrait.FaceBounds)); }
public void PublishPortrait(Portrait portrait) { }
public void SavePortrait(Portrait portrait) { }
public void HandlePortrait(Portrait portrait) { var clone = portrait.Clone(); Action action = () => { var group = faceGalleryControl.Gallery.Groups[0]; if (group.Items.Count > 20) { group.Items.Remove(group.Items[group.Items.Count - 1]); } var caption = clone.CapturedAt.ToShortTimeString(); var item = new GalleryItem(clone.GetIpl().ToBitmap(), caption, null); item.Tag = clone; this.faceGalleryControl.Gallery.Groups[0].Items.Insert(0, item); ShowBigImage(clone); }; if (InvokeRequired) { this.BeginInvoke(action); } else { action(); } }
private void ShowPreviewImage(Portrait portrait) { ShowBigImage(portrait); _selectedObject = portrait; }
public void PublishPortrait(Portrait portrait) { var e = new EventArgs<Portrait>(portrait); this.InvokePortraitFound(e); }
private void NotifyListeners(Portrait portrait, IEnumerable<RepositoryCompareResult> matches) { foreach (var match in matches) { var args = new PersonOfInterestDetectionResult { Details = match.PersonInfo, Portrait = portrait, Similarity = match.Similarity }; if (EventAggregator != null) { EventAggregator.PublishFaceMatchEvent(args); } } }