protected override void OnFrame(Parsley.Core.BuildingBlocks.FrameGrabber fp, Emgu.CV.Image <Emgu.CV.Structure.Bgr, byte> img) { Parsley.Core.ExtrinsicCalibration ec; ExtrinsicCameraParameters ecp; bool pattern_found = false; Core.CalibrationPattern p = _pattern; if (p != null) { Image <Gray, Byte> gray = img.Convert <Gray, Byte>(); pattern_found = p.FindPattern(gray); p.DrawPattern(img, p.ImagePoints, p.PatternFound); // if pattern has been found ==> find extrinsics and draw the corresponding coordinate frame if (pattern_found == true && Context.Setup.Camera.Intrinsics != null) { ec = new Parsley.Core.ExtrinsicCalibration(p.ObjectPoints, Context.Setup.Camera.Intrinsics); ecp = ec.Calibrate(p.ImagePoints); if (ecp != null) { Core.Drawing.DrawCoordinateFrame(img, ecp, Context.Setup.Camera.Intrinsics); } } } base.OnFrame(fp, img); }
protected override void OnFrame(Parsley.Core.BuildingBlocks.FrameGrabber fp, Emgu.CV.Image <Emgu.CV.Structure.Bgr, byte> img) { Core.CalibrationPattern pattern = _pattern; if (pattern != null) { Image <Gray, Byte> gray = img.Convert <Gray, Byte>(); pattern.FindPattern(gray); this.UpdateStatusDisplay(pattern.PatternFound); this.HandleCalibrateRequest(); this.HandleTakeImageRequest(); this.DrawCoordinateFrame(img); pattern.DrawPattern(img, pattern.ImagePoints, pattern.PatternFound); } }
protected override void OnFrame(Parsley.Core.BuildingBlocks.FrameGrabber fp, Emgu.CV.Image <Emgu.CV.Structure.Bgr, byte> img) { Core.CalibrationPattern pattern = _pattern; if (pattern != null) { //cari pola kalibrasi jika marker kalibrasi tersedia Image <Gray, Byte> gray = img.Convert <Gray, Byte>(); //convert image to grayscale pattern.FindPattern(gray); //cari pola kalibrasi this.UpdateStatusDisplay(pattern.PatternFound); this.HandleCalibrateRequest(); this.HandleTakeImageRequest(); this.DrawCoordinateFrame(img); pattern.DrawPattern(img, pattern.ImagePoints, pattern.PatternFound); //gambar AR pada marker jika pattern ditemukan } }