示例#1
0
        private List <СharacteristicPoint> DetectLocalMaximumPoints(СharacteristicPoint[,] responces)
        {
            List <СharacteristicPoint> filteredPoints = new List <СharacteristicPoint>();

            try
            {
                ApertureEnumerator enumerator = new ApertureEnumerator(responces, filteredApertureSize);

                while (enumerator.MoveNext())
                {
                    СharacteristicPoint localMaxResponcePoint =
                        enumerator.Current.OrderByDescending(e => e.ResponseAngle).First();

                    if (localMaxResponcePoint.ResponseAngle > default(double))
                    {
                        filteredPoints.Add(localMaxResponcePoint);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Current.Error(ex);
                throw;
            }

            return(filteredPoints);
        }
示例#2
0
        public СharacteristicPoint[] Detect(LockableBitmap source)
        {
            InitializeGradients(source);

            СharacteristicPoint[,] responces = new СharacteristicPoint[source.Width, source.Height];

            for (int y = 0; y < source.Height; y++)
            {
                for (int x = 0; x < source.Width; x++)
                {
                    double response = responseAngle.Calculate(dfx[x, y], dfy[x, y], dfxy[x, y]);

                    response = response > threshold ? response : default(double);

                    responces[x, y] = new СharacteristicPoint(
                        new Point(x, y),
                        response);
                }
            }

            List <СharacteristicPoint> filteredPoints = DetectLocalMaximumPoints(responces);

            return(filteredPoints.ToArray());
        }