Exemple #1
0
        /// <summary>
        /// Computes the descriptor as the maximums of an array of filter responses.
        /// </summary>
        /// <param name="samples">Samples to compute the filter bank response for</param>
        /// <param name="pyramid">Pyramid to use when computing responses</param>
        /// <returns>Filter bank descriptor</returns>
        public override List <Keypoint> Compute <T>(List <ScaleSpaceSample> samples, ScaleSpacePyramid <T> pyramid)
        {
            List <Keypoint> points = base.Compute <T>(samples, pyramid);

            foreach (var point in points)
            {
                point.Descriptor = maximumResponse(point.Descriptor);
            }
            return(points);
        }
Exemple #2
0
        /// <summary>
        /// Computes the descriptor as an array of filter responses.
        /// </summary>
        /// <param name="samples">Samples to compute the filter bank response for</param>
        /// <param name="pyramid">Pyramid to use when computing responses</param>
        /// <returns>Filter bank descriptor</returns>
        public virtual List <Keypoint> Compute <T>(List <ScaleSpaceSample> samples, ScaleSpacePyramid <T> pyramid) where T : IMultichannelImage <float>, new()
        {
            List <Keypoint> points = new List <Keypoint>();

            foreach (ScaleSpaceSample sample in samples)
            {
                float[] desc = new float[_filters.Count];
                for (int i = 0; i < desc.Length; i++)
                {
                    desc[i] = _filters[i].Compute <T>(sample, pyramid);
                }
                Keypoint point = new Keypoint(sample.X, sample.Y, sample.ImageScale, pyramid.ComputeSigma(sample.Octave, sample.Level), 0);
                point.Descriptor = desc;
                points.Add(point);
            }
            return(points);
        }
Exemple #3
0
 /// <summary>
 /// Computes filter by multiplying the filter values against the patch values.  If the patch or filter
 /// sizes do not match up, the two will be centered on each other and computation done on overlapping
 /// indices.
 /// </summary>
 /// <param name="sample">Sample to compute</param>
 /// <param name="pyramid">Pyramid to use for computation</param>
 /// <returns>Filter response for the desired sample</returns>
 public unsafe float Compute <T>(ScaleSpaceSample sample, ScaleSpacePyramid <T> pyramid) where T : IMultichannelImage <float>, new()
 {
     return(compute(sample.Row, sample.Column, pyramid[sample.Octave, sample.Level]));
 }