/// <summary>
        /// Update the view of the binding values
        /// </summary>
        /// <param name="binding"></param>
        private ImageRectifierBindingInputFeatureValues ExtractBindingValues(ISkillBinding binding)
        {
            ImageRectifierBindingInputFeatureValues result = new ImageRectifierBindingInputFeatureValues();

            var inputQuadFeature      = binding["InputQuad"].FeatureValue;
            var inputQuadFeatureValue = (inputQuadFeature as SkillFeatureTensorFloatValue).GetAsVectorView();

            for (int i = 0; i < inputQuadFeatureValue.Count; i += 2)
            {
                result.InputQuad[i / 2] = new Point(inputQuadFeatureValue[i], inputQuadFeatureValue[i + 1]);
            }
            var interpolationType             = binding["InterpolationType"].FeatureValue;
            var interpolationTypeFeatureValue = (interpolationType as SkillFeatureTensorStringValue).GetAsVectorView();

            result.InterpolationType = (ImageRectifierInterpolationKind)Enum.GetNames(typeof(ImageRectifierInterpolationKind)).ToList().IndexOf(interpolationTypeFeatureValue[0]);

            return(result);
        }
        /// <summary>
        /// ImageRectifierControl constructor
        /// </summary>
        /// <param name="binding"></param>
        public ImageRectifierControl(ISkillBinding binding) : base(binding)
        {
            // Update the view of the initial binding values
            m_ImageRectifierBindingFeatureValues = ExtractBindingValues(binding);
            m_interactiveControl = new ImageRectifierInteractiveControl();
            m_interactiveControl.InterpolationTypeChanged += ImageRectifierInteractiveControl_InterpolationTypeChanged;

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

            // Add InputQuad control
            m_inputQuadRenderer = new InteractiveQuadRenderer(ref m_canvas);
            m_inputQuadRenderer.CornersChanged         += InteractiveQuadRenderer_CornersChanged;
            m_inputQuadRenderer.CornersChangeCompleted += InteractiveQuadRenderer_CornersChangeCompleted;
            m_inputQuadRenderer.Update(m_ImageRectifierBindingFeatureValues.InputQuad);

            Children.Add(m_interactiveControl);
            m_interactiveControl.UpdateDisplayedInputValues(m_ImageRectifierBindingFeatureValues);
            m_interactiveControl.UpdateInterpolationType(m_ImageRectifierBindingFeatureValues.InterpolationType);
        }
 /// <summary>
 /// Update displayed input values
 /// </summary>
 /// <param name="initialValues"></param>
 public void UpdateDisplayedInputValues(ImageRectifierBindingInputFeatureValues initialValues)
 {
     UpdateInputQuadCorners(initialValues.InputQuad);
 }