示例#1
0
        /// <summary>
        ///   Determine dominant orientation for the feature point.
        /// </summary>
        ///
        public double GetOrientation(SpeededUpRobustFeaturePoint point)
        {
            // Get rounded feature point data
            int x = (int)System.Math.Round(point.X, 0);
            int y = (int)System.Math.Round(point.Y, 0);
            int s = (int)System.Math.Round(point.Scale, 0);

            // Get the orientation (for rotation invariance)
            return(this.GetOrientation(x, y, s));
        }
示例#2
0
        /// <summary>
        ///   Describes the specified point (i.e. computes and
        ///   sets the orientation and descriptor vector fields
        ///   of the <see cref="SpeededUpRobustFeaturePoint"/>.
        /// </summary>
        ///
        /// <param name="point">The point to be described.</param>
        ///
        public void Compute(SpeededUpRobustFeaturePoint point)
        {
            // Get rounded feature point data
            int x = (int)System.Math.Round(point.X, 0);
            int y = (int)System.Math.Round(point.Y, 0);
            int s = (int)System.Math.Round(point.Scale, 0);

            if (this.invariant)
            {
                // Get the orientation (for rotation invariance)
                point.Orientation = this.GetOrientation(x, y, s);
            }

            // Extract SURF descriptor
            point.Descriptor = this.GetDescriptor(x, y, s, point.Orientation);
        }