Example #1
0
        private void ProcessFrame2(object sender, EventArgs e)
        {
            Image <Bgr, Byte> frame = cap.RetrieveBgrFrame();

            using (Image <Gray, Byte> modelImage = new Image <Gray, byte>(fileNameText))
                using (Image <Gray, Byte> observedImage = frame.Convert <Gray, Byte>())
                {
                    Image <Bgr, byte> result = DrawMatches.Draw(modelImage, observedImage, out matchTime);
                    imageBox3.Image = result;
                }
        }
Example #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            long matchTime;

            using (Image <Gray, Byte> modelImage = new Image <Gray, byte>("box.png"))
                using (Image <Gray, Byte> observedImage = new Image <Gray, byte>("box_in_scene.png"))
                {
                    Mat result = DrawMatches.Draw(modelImage, observedImage, out matchTime);
                    ImageViewer.Show(result, String.Format("Matched using {0} in {1} milliseconds", CudaInvoke.HasCuda ? "GPU" : "CPU", matchTime));
                }
        }