SampleApp.MainForm.btnCorrelation_Click C# (CSharp) Method

btnCorrelation_Click() private method

private btnCorrelation_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btnCorrelation_Click(object sender, EventArgs e)
        {
            if (keyPoints1 == null)
            {
                MessageBox.Show("Please, click FREAK button first! :-)");
                return;
            }

            // Step 2: Match feature points using a k-NN
            var matcher = new KNearestNeighborMatching<byte[]>(5, new Hamming());
            IntPoint[][] matches = matcher.Match(keyPoints1, keyPoints2);
            
            // Get the two sets of points
            correlationPoints1 = matches[0];
            correlationPoints2 = matches[1];

            // Concatenate the two images in a single image (just to show on screen)
            Concatenate concat = new Concatenate(img1);
            Bitmap img3 = concat.Apply(img2);

            // Show the marked correlations in the concatenated image
            PairsMarker pairs = new PairsMarker(
                correlationPoints1, // Add image1's width to the X points to show the markings correctly
                correlationPoints2.Apply(p => new IntPoint(p.X + img1.Width, p.Y)));

            pictureBox.Image = pairs.Apply(img3);
        }
MainForm