コード例 #1
0
        private Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData GetAKazeData()
        {
            var   descType     = AKAZE.DescriptorType.Kaze;
            var   diffType     = KAZE.Diffusivity.PmG2;
            int   descSize     = 0;
            int   descChannels = 3;
            float descThresh   = 0.001f;
            int   descOcts     = 4;
            int   descLayers   = 4;

            synchronizationContext.Send(new SendOrPostCallback(
                                            delegate(object state)
            {
                descType     = (AKAZE.DescriptorType)akazeDescTypeValueBox.SelectedIndex;
                descSize     = (int)akazeDescSizeValueBox.IntegerValue;
                descChannels = (int)akazeDescChannelsValueBox.IntegerValue;
                descThresh   = (float)akazeDescThresholdValueBox.DoubleValue;
                descOcts     = (int)akazeOctavesValueBox.IntegerValue;
                descLayers   = (int)akazeLayersOptionValueBox.IntegerValue;
                diffType     = (KAZE.Diffusivity)akazeDiffTypeValueBox.SelectedIndex;
            }
                                            ), null);

            Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData aKazeData = new Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData(descType, descSize, descChannels, descThresh, descOcts, descLayers, diffType);
            return(aKazeData);
        }
コード例 #2
0
 private void SetAKazeData(Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData aKazeData)
 {
     synchronizationContext.Send(new SendOrPostCallback(
                                     delegate(object state)
     {
         akazeDescTypeValueBox.SelectedIndex    = (int)aKazeData.DescriptorType;
         akazeDescSizeValueBox.IntegerValue     = aKazeData.DescriptorSize;
         akazeDescChannelsValueBox.IntegerValue = aKazeData.Channels;
         akazeDescThresholdValueBox.DoubleValue = aKazeData.Threshold;
         akazeOctavesValueBox.IntegerValue      = aKazeData.Octaves;
         akazeLayersOptionValueBox.IntegerValue = aKazeData.Layers;
         akazeDiffTypeValueBox.SelectedValue    = aKazeData.Diffusivity;
     }
                                     ), null);
 }
コード例 #3
0
 public void InitializeAKazePanel(Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData aKazeData, bool isUseStoredEnabled)
 {
     synchronizationContext.Send(new SendOrPostCallback(
                                     delegate(object state)
     {
         akazeDescTypeValueBox.SelectedIndex           = (int)aKazeData.DescriptorType;
         akazeDescSizeValueBox.IntegerValue            = aKazeData.DescriptorSize;
         akazeDescChannelsValueBox.IntegerValue        = aKazeData.Channels;
         akazeDescThresholdValueBox.DoubleValue        = aKazeData.Threshold;
         akazeOctavesValueBox.IntegerValue             = aKazeData.Octaves;
         akazeLayersOptionValueBox.IntegerValue        = aKazeData.Layers;
         akazeDiffTypeValueBox.SelectedValue           = aKazeData.Diffusivity;
         akazeUseStoredModelFeaturesToggle.ToggleState = isUseStoredEnabled ? Syncfusion.Windows.Forms.Tools.ToggleButtonState.Active : Syncfusion.Windows.Forms.Tools.ToggleButtonState.Inactive;
     }
                                     ), null);
 }
コード例 #4
0
        public AKazeSettingsControl(Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData akazeData, bool isUseStoredEnabled, int pipelineIndex)
        {
            InitializeComponent();

            synchronizationContext = SynchronizationContext.Current;
            this.akazeData         = akazeData;
            initialIsUseStoredModelFeaturesBool = isUseStoredEnabled;
            this.pipelineIndex = pipelineIndex;

            akazeDiffTypeValueBox.DataSource    = EnumHelper.ToList(typeof(KAZE.Diffusivity));
            akazeDiffTypeValueBox.DisplayMember = "Value";
            akazeDiffTypeValueBox.ValueMember   = "Key";

            akazeDescTypeValueBox.DataSource    = EnumHelper.ToList(typeof(AKAZE.DescriptorType));
            akazeDescTypeValueBox.DisplayMember = "Value";
            akazeDescTypeValueBox.ValueMember   = "Key";

            InitializeAKazePanel(akazeData, isUseStoredEnabled);
        }
コード例 #5
0
        private void SetBtn_Click(object sender, EventArgs e)
        {
            Template.RegistrationAlignmentMethod.RegistrationMethodType registrationMethodType = (Template.RegistrationAlignmentMethod.RegistrationMethodType)registrationTypeTabControl.SelectedIndex;
            switch (registrationMethodType)
            {
            case Template.RegistrationAlignmentMethod.RegistrationMethodType.KAZE:
                Template.RegistrationAlignmentMethod.KazeRegistrationMethod.KazeData kazeData = GetKazeData();
                Template.RegistrationAlignmentMethod.KazeRegistrationMethod          kazeRegistrationMethod = new Template.RegistrationAlignmentMethod.KazeRegistrationMethod(kazeData);
                selectedRegistrationAlignmentMethod = new Template.RegistrationAlignmentMethod(pipelineIndex, methodName, kazeRegistrationMethod, templateImage, templateImage.Size);
                break;

            case Template.RegistrationAlignmentMethod.RegistrationMethodType.AKAZE:
                Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData aKazeData = GetAKazeData();
                Template.RegistrationAlignmentMethod.AKazeRegistrationMethod           aKazeRegistrationMethod = new Template.RegistrationAlignmentMethod.AKazeRegistrationMethod(aKazeData);
                selectedRegistrationAlignmentMethod = new Template.RegistrationAlignmentMethod(pipelineIndex, methodName, aKazeRegistrationMethod, templateImage, templateImage.Size);
                break;
            }

            if (useStoredModelFeaturesToggle.ToggleState == ToggleButtonState.Active)
            {
                selectedRegistrationAlignmentMethod.StoreModelFeatures(templateImage, true);
            }

            if (!genModelFeaturesBtn.Enabled)
            {
                genModelFeaturesBtn.Enabled          = true;
                useStoredModelFeaturesToggle.Enabled = true;
            }

            useStoredModelFeaturesToggle.ToggleState = selectedRegistrationAlignmentMethod.GetUseStoredModelFeatures? ToggleButtonState.Active : ToggleButtonState.Inactive;
        }
コード例 #6
0
        private void SetupForConfigured(Template.RegistrationAlignmentMethod registrationAlignmentMethod)
        {
            selectedRegistrationAlignmentMethod = registrationAlignmentMethod;
            var registrationMethodType = selectedRegistrationAlignmentMethod.GetRegistrationMethod.GetRegistrationMethodType;

            registrationTypeTabControl.SelectedIndex = (int)registrationMethodType;

            switch (registrationMethodType)
            {
            case Template.RegistrationAlignmentMethod.RegistrationMethodType.KAZE:
                Template.RegistrationAlignmentMethod.KazeRegistrationMethod          kazeRegistrationMethod = (Template.RegistrationAlignmentMethod.KazeRegistrationMethod)registrationAlignmentMethod.GetRegistrationMethod;
                Template.RegistrationAlignmentMethod.KazeRegistrationMethod.KazeData kazeData = kazeRegistrationMethod.GetKazeData;
                SetKazeData(kazeData);
                break;

            case Template.RegistrationAlignmentMethod.RegistrationMethodType.AKAZE:
                Template.RegistrationAlignmentMethod.AKazeRegistrationMethod           aKazeRegistrationMethod = (Template.RegistrationAlignmentMethod.AKazeRegistrationMethod)registrationAlignmentMethod.GetRegistrationMethod;
                Template.RegistrationAlignmentMethod.AKazeRegistrationMethod.AKazeData aKazeData = aKazeRegistrationMethod.GetAKazeData;
                SetAKazeData(aKazeData);
                break;
            }

            genModelFeaturesBtn.Enabled              = true;
            useStoredModelFeaturesToggle.Enabled     = true;
            useStoredModelFeaturesToggle.ToggleState = selectedRegistrationAlignmentMethod.GetUseStoredModelFeatures? ToggleButtonState.Active : ToggleButtonState.Inactive;
        }