private void ProcessFrame(object sender, EventArgs arg) { if (_capture != null && _capture.Ptr != IntPtr.Zero) { _capture.Retrieve(_frame, 0); ibxModel.Image = _frame; long matchTime; Image <Bgr, Byte> rstImg = new Image <Bgr, Byte>(ibxModel.Image.Bitmap); using (Mat modelImage = rstImg.Mat) using (Mat observedImage = CvInvoke.Imread(ModelImage, ImreadModes.Color)) { Mat result = FeatureMatch.Draw(modelImage, observedImage, out matchTime); ibxResult.Image = result; } } }
private void btnSelectImages_Click(object sender, EventArgs e) { ModelImage = getImage("Model"); ibxModel.Image = CvInvoke.Imread(ModelImage, ImreadModes.Color); OtherImage = getImage("Test"); if (!String.IsNullOrEmpty(ModelImage) && !String.IsNullOrEmpty(OtherImage)) { long matchTime; using (Mat modelImage = CvInvoke.Imread(ModelImage, ImreadModes.Color)) using (Mat observedImage = CvInvoke.Imread(OtherImage, ImreadModes.Color)) { Mat result = FeatureMatch.Draw(modelImage, observedImage, out matchTime); ibxResult.Image = result; } } }