Ejemplo n.º 1
0
        /// <summary>
        /// Интерполирование найденных Гессианов соседей 3x3x3
        /// </summary>
        void interpolateExtremum(int r, int c, ResponseLayer t, ResponseLayer m, ResponseLayer b)
        {
            Matrix D  = Matrix.Create(BuildDerivative(r, c, t, m, b));
            Matrix H  = Matrix.Create(BuildHessian(r, c, t, m, b));
            Matrix Hi = H.Inverse();
            Matrix Of = -1 * Hi * D;

            double[] O = { Of[0, 0], Of[1, 0], Of[2, 0] };

            // шаг между фильтрами
            int filterStep = (m.filter - b.filter);

            // если точка достаточно близка к фактическому экстремуму
            if (Math.Abs(O[0]) < 0.5f && Math.Abs(O[1]) < 0.5f && Math.Abs(O[2]) < 0.5f)
            {
                InterestPoint iPoint = new InterestPoint();
                iPoint.x         = (float)((c + O[0]) * t.step);
                iPoint.y         = (float)((r + O[1]) * t.step);
                iPoint.scale     = (float)((0.1333f) * (m.filter + O[2] * filterStep));
                iPoint.laplacian = (int)(m.getLaplacian(r, c, t));
                iPoints.Add(iPoint);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Interpolate scale-space maximum points to subpixel accuracy to form an image feature.
        /// </summary>
        ///
        /// <param name="r">The row to be tested.</param>
        /// <param name="c">The column to be tested.</param>
        ///
        /// <param name="t">Top response layer.</param>
        /// <param name="m">Middle response layer.</param>
        /// <param name="b">Bottom response layer.</param>
        ///
        void interpolateExtremum(int r, int c, ResponseLayer t, ResponseLayer m, ResponseLayer b)
        {
            var D  = BuildDerivative(r, c, t, m, b);
            var H  = BuildHessian(r, c, t, m, b);
            var Hi = Matrix.Inverse(H);
            var Of = (-1.0).Multiply(Hi).Multiply(D);

            // get the offsets from the interpolation
            double[] O = { Of[0, 0], Of[1, 0], Of[2, 0] };

            // get the step distance between filters
            int filterStep = (m.filter - b.filter);

            // If point is sufficiently close to the actual extremum
            if (Math.Abs(O[0]) < 0.5f && Math.Abs(O[1]) < 0.5f && Math.Abs(O[2]) < 0.5f)
            {
                IPoint ipt = new IPoint();
                ipt.x         = (float)((c + O[0]) * t.step);
                ipt.y         = (float)((r + O[1]) * t.step);
                ipt.scale     = (float)((0.1333f) * (m.filter + O[2] * filterStep));
                ipt.laplacian = (int)(m.getLaplacian(r, c, t));
                ipts.Add(ipt);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Interpolate scale-space extrema to subpixel accuracy to form an image feature
        /// </summary>
        /// <param name="r"></param>
        /// <param name="c"></param>
        /// <param name="t"></param>
        /// <param name="m"></param>
        /// <param name="b"></param>
        void interpolateExtremum(int r, int c, ResponseLayer t, ResponseLayer m, ResponseLayer b)
        {
            Matrix D = Matrix.Create(BuildDerivative(r, c, t, m, b));
              Matrix H = Matrix.Create(BuildHessian(r, c, t, m, b));
              Matrix Hi = H.Inverse();
              Matrix Of = -1 * Hi * D;

              // get the offsets from the interpolation
              double[] O = { Of[0, 0], Of[1, 0], Of[2, 0] };

              // get the step distance between filters
              int filterStep = (m.filter - b.filter);

              // If point is sufficiently close to the actual extremum
              if (Math.Abs(O[0]) < 0.5f && Math.Abs(O[1]) < 0.5f && Math.Abs(O[2]) < 0.5f)
              {
            IPoint ipt = new IPoint();
            ipt.x = (float)((c + O[0]) * t.step);
            ipt.y = (float)((r + O[1]) * t.step);
            ipt.scale = (float)((0.1333f) * (m.filter + O[2] * filterStep));
            ipt.laplacian = (int)(m.getLaplacian(r,c,t));
            ipts.Add(ipt);
              }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Интерполирование найденных Гессианов соседей 3x3x3
        /// </summary>
        void interpolateExtremum(int r, int c, ResponseLayer t, ResponseLayer m, ResponseLayer b)
        {
            Matrix D = Matrix.Create(BuildDerivative(r, c, t, m, b));
            Matrix H = Matrix.Create(BuildHessian(r, c, t, m, b));
            Matrix Hi = H.Inverse();
            Matrix Of = -1 * Hi * D;

            double[] O = { Of[0, 0], Of[1, 0], Of[2, 0] };

            // шаг между фильтрами
            int filterStep = (m.filter - b.filter);

            // если точка достаточно близка к фактическому экстремуму
            if (Math.Abs(O[0]) < 0.5f && Math.Abs(O[1]) < 0.5f && Math.Abs(O[2]) < 0.5f)
            {
                InterestPoint iPoint = new InterestPoint();
                iPoint.x = (float)((c + O[0]) * t.step);
                iPoint.y = (float)((r + O[1]) * t.step);
                iPoint.scale = (float)((0.1333f) * (m.filter + O[2] * filterStep));
                iPoint.laplacian = (int)(m.getLaplacian(r, c, t));
                iPoints.Add(iPoint);
            }
        }