Example #1
0
 internal extern static IntPtr cveKAZEDetectorCreate(
     [MarshalAs(CvInvoke.BoolMarshalType)]
     bool extended,
     [MarshalAs(CvInvoke.BoolMarshalType)]
     bool upright,
     float threshold,
     int octaves, int sublevels, KAZE.Diffusivity diffusivity,
     ref IntPtr feature2D);
Example #2
0
 /// <summary>
 /// Create AKAZE using the specific values
 /// </summary>
 /// <param name="descriptorType">Type of the extracted descriptor</param>
 /// <param name="descriptorSize">Size of the descriptor in bits. 0 -> Full size</param>
 /// <param name="descriptorChannels">Number of channels in the descriptor (1, 2, 3)</param>
 /// <param name="threshold">Detector response threshold to accept point</param>
 /// <param name="sublevels"> Default number of sublevels per scale level</param>
 /// <param name="octaves">Maximum octave evolution of the image</param>
 /// <param name="diffusivity">Diffusivity type</param>
 public AKAZE(DescriptorType descriptorType = DescriptorType.Mldb, int descriptorSize = 0, int descriptorChannels = 3,
              float threshold = 0.001f, int octaves = 4, int sublevels = 4, KAZE.Diffusivity diffusivity = KAZE.Diffusivity.PmG2)
 {
     _ptr = CvInvoke.cveAKAZEDetectorCreate(
         descriptorType, descriptorSize, descriptorChannels,
         threshold, octaves, sublevels, diffusivity,
         ref _feature2D);
 }
Example #3
0
 internal static extern IntPtr cveAKAZEFeaturesFinderCreate(
     AKAZE.DescriptorType descriptorType,
     int descriptorSize,
     int descriptorChannels,
     float threshold,
     int nOctaves,
     int nOctaveLayers,
     KAZE.Diffusivity diffusivity,
     ref IntPtr f);
Example #4
0
 /// <summary>
 /// Creates an AKAZE features finder
 /// </summary>
 /// <param name="descriptorType">Type of the extracted descriptor</param>
 /// <param name="descriptorSize">Size of the descriptor in bits. 0 -> Full size</param>
 /// <param name="descriptorChannels">Number of channels in the descriptor (1, 2, 3)</param>
 /// <param name="threshold">Detector response threshold to accept point</param>
 /// <param name="nOctaveLayers"> Default number of sublevels per scale level</param>
 /// <param name="nOctaves">Maximum octave evolution of the image</param>
 /// <param name="diffusivity">Diffusivity type</param>
 public AKAZEFeaturesFinder(
     AKAZE.DescriptorType descriptorType,
     int descriptorSize,
     int descriptorChannels,
     float threshold,
     int nOctaves,
     int nOctaveLayers,
     KAZE.Diffusivity diffusivity)
 {
     _ptr = StitchingInvoke.cveAKAZEFeaturesFinderCreate(
         descriptorType, descriptorSize, descriptorChannels, threshold, nOctaves, nOctaveLayers, diffusivity,
         ref _featuresFinderPtr);
 }
Example #5
0
 /// <summary>
 /// Creates an AKAZE features finder
 /// </summary>
 /// <param name="descriptorType">Type of the extracted descriptor</param>
 /// <param name="descriptorSize">Size of the descriptor in bits. 0 -> Full size</param>
 /// <param name="descriptorChannels">Number of channels in the descriptor (1, 2, 3)</param>
 /// <param name="threshold">Detector response threshold to accept point</param>
 /// <param name="nOctaveLayers"> Default number of sublevels per scale level</param>
 /// <param name="nOctaves">Maximum octave evolution of the image</param>
 /// <param name="diffusivity">Diffusivity type</param>
 public AKAZEFeaturesFinder(
     AKAZE.DescriptorType descriptorType = AKAZE.DescriptorType.Mldb,
     int descriptorSize           = 0,
     int descriptorChannels       = 3,
     float threshold              = 0.001f,
     int nOctaves                 = 4,
     int nOctaveLayers            = 4,
     KAZE.Diffusivity diffusivity = KAZE.Diffusivity.PmG2)
 {
     _ptr = StitchingInvoke.cveAKAZEFeaturesFinderCreate(
         descriptorType, descriptorSize, descriptorChannels, threshold, nOctaves, nOctaveLayers, diffusivity,
         ref _featuresFinderPtr);
 }
Example #6
0
 /// <summary>
 /// Create AKAZE using the specific values
 /// </summary>
 /// <param name="descriptorType">Type of the extracted descriptor</param>
 /// <param name="descriptorSize">Size of the descriptor in bits. 0 -> Full size</param>
 /// <param name="descriptorChannels">Number of channels in the descriptor (1, 2, 3)</param>
 /// <param name="threshold">Detector response threshold to accept point</param>
 /// <param name="nOctaveLayers"> Default number of sublevels per scale level</param>
 /// <param name="nOctaves">Maximum octave evolution of the image</param>
 /// <param name="diffusivity">Diffusivity type</param>
 public AKAZE(
     DescriptorType descriptorType = DescriptorType.Mldb,
     int descriptorSize            = 0,
     int descriptorChannels        = 3,
     float threshold              = 0.001f,
     int nOctaves                 = 4,
     int nOctaveLayers            = 4,
     KAZE.Diffusivity diffusivity = KAZE.Diffusivity.PmG2)
 {
     _ptr = Features2DInvoke.cveAKAZEDetectorCreate(
         descriptorType, descriptorSize, descriptorChannels,
         threshold, nOctaves, nOctaveLayers, diffusivity,
         ref _feature2D, ref _sharedPtr);
 }
Example #7
0
 internal extern static IntPtr cveAKAZEDetectorCreate(
     AKAZE.DescriptorType descriptorType, int descriptorSize, int descriptorChannels,
     float threshold, int octaves, int nOctaveLayers, KAZE.Diffusivity diffusivity,
     ref IntPtr feature2D, ref IntPtr sharedPtr);
Example #8
0
        private void open_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(Convert.ToString(treshold));
            if (KazeRadio.Checked)
            {
                descriptorTipus = AKAZE.DescriptorType.Kaze;
            }
            else if (KazeUpRadio.Checked)
            {
                descriptorTipus = AKAZE.DescriptorType.KazeUpright;
            }
            else if (MldbRadio.Checked)
            {
                descriptorTipus = AKAZE.DescriptorType.Mldb;
            }
            else if (MldbUpRadio.Checked)
            {
                descriptorTipus = AKAZE.DescriptorType.MldbUpright;
            }
            else
            {
                MldbRadio.Checked = true;
            }


            if (Channel1Radio.Checked)
            {
                channelNumber = 1;
            }
            else if (Channel2Radio.Checked)
            {
                channelNumber = 2;
            }
            else if (Channerl3Radio.Checked)
            {
                channelNumber = 3;
            }
            else
            {
                Channerl3Radio.Checked = true;
            }

            if (CharbonnierRadio.Checked)
            {
                difuzivitasi = KAZE.Diffusivity.Charbonnier;
            }
            else if (PmG1Radio.Checked)
            {
                difuzivitasi = KAZE.Diffusivity.PmG1;
            }
            else if (PmG2Radio.Checked)
            {
                difuzivitasi = KAZE.Diffusivity.PmG2;
            }
            else if (WeickerRadio.Checked)
            {
                difuzivitasi = KAZE.Diffusivity.Weickert;
            }
            else
            {
                PmG1Radio.Checked = true;
            }


            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Multiselect = true;
            dlg.Filter      = "jpg files (*.jpg)|*.jpg";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                dataGridViewKepek.Rows.Clear();
                Image <Bgr, byte>[] forrasKepek = new Image <Bgr, byte> [dlg.FileNames.Length];
                for (int i = 0; i < forrasKepek.Length; i++)
                {
                    forrasKepek[i] = new Image <Bgr, byte>(dlg.FileNames[i]);
                    using (Image <Bgr, byte> miniPicture = forrasKepek[i].Resize(200, 200, Emgu.CV.CvEnum.Inter.Cubic, true))
                    {
                        DataGridViewRow sor = dataGridViewKepek.Rows[dataGridViewKepek.Rows.Add()];
                        sor.Cells["FileName"].Value = dlg.FileNames[i];
                        sor.Cells["View"].Value     = miniPicture.ToBitmap();
                        sor.Height = 200;
                    }
                }
                miniPicture = null;
                try
                {
                    //0 - Panormáma; 1 - Szekkenlés
                    //true - Try GPU; false - No
                    using (Stitcher varras = new Stitcher(0, true))
                    {
                        using (AKAZEFeaturesFinder kereso = new AKAZEFeaturesFinder(descriptorTipus, 0, channelNumber, treshold, 4, 4, difuzivitasi))
                        {
                            varras.SetFeaturesFinder(kereso);
                            using (VectorOfMat vm = new VectorOfMat())
                            {
                                Mat result = new Mat();
                                vm.Push(forrasKepek);
                                Stitcher.Status stitchStatus = varras.Stitch(vm, result);
                                if (stitchStatus == Stitcher.Status.Ok)
                                {
                                    resultImage.Image = result;
                                    forrasKepek       = null;
                                }
                                else
                                {
                                    MessageBox.Show(this, String.Format("Stiching Error: {0}", stitchStatus));
                                    resultImage.Image = null;
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }