Beispiel #1
0
        /// <summary>
        /// Update the view of the binding values
        /// </summary>
        /// <param name="binding"></param>
        private QuadEdgesDetectorBindingInputFeatureValues ExtractBindingValues(ISkillBinding binding)
        {
            QuadEdgesDetectorBindingInputFeatureValues result = new QuadEdgesDetectorBindingInputFeatureValues();

            result.MaxQuadEdges = (binding["MaxDetectedEdges"].FeatureValue as SkillFeatureTensorIntValue).GetAsVectorView()[0];

            return(result);
        }
Beispiel #2
0
        /// <summary>
        ///  QuadEdgesDetectorControl constructor
        /// </summary>
        /// <param name="binding"></param>
        public QuadEdgesDetectorControl(ISkillBinding binding) : base(binding)
        {
            // Update the view of the initial binding values
            m_quadEdgesDetectorBindingFeatureValues = ExtractBindingValues(binding);
            m_interactiveControl = new QuadEdgesDetectorSkillInteractiveControl();
            m_interactiveControl.MaxQuadEdgesValueChanged += QuadEdgesDetectorSkillInteractiveControl_MaxQuadEdgesValueChanged;

            m_imageGrid.Children.Add(m_canvas);
            m_image.SetValue(Canvas.ZIndexProperty, -1);
            m_image.SizeChanged += Image_SizeChanged;

            // Add line results controls
            m_verticalLinesResultRenderer             = new LineSetRenderer(ref m_canvas, Colors.Blue);
            m_verticalLinesResultRenderer.IsVisible   = false;
            m_horizontalLinesResultRenderer           = new LineSetRenderer(ref m_canvas, Colors.Orange);
            m_horizontalLinesResultRenderer.IsVisible = false;

            Children.Add(m_interactiveControl);
            m_interactiveControl.UpdateDisplayedInputValues(m_quadEdgesDetectorBindingFeatureValues);
        }
Beispiel #3
0
 /// <summary>
 /// Update displayed values
 /// </summary>
 /// <param name="initialValues"></param>
 public void UpdateDisplayedInputValues(QuadEdgesDetectorBindingInputFeatureValues initialValues)
 {
     UIMaxQuadEdges.Value = initialValues.MaxQuadEdges;
 }