Exemplo n.º 1
0
        /// <summary>
        /// Finds the hole in the image matrix, based on the supplied boundary trace algorithm
        /// </summary>
        /// <param name="trace">A trace algorithm to be used to find the boundary of the hole</param>
        /// <returns></returns>
        public Hole FindHole(ITraceAlgorithm trace)
        {
            var boundary  = FindBoundary(trace);
            var rectangle = FindCoveringRectangle(boundary);
            var hole      = FindHole(rectangle);

            if (boundary != null)
            {
                Hole = new Hole(boundary, hole, rectangle);
            }
            else
            {
                Hole = null;
            }

            return(Hole);
        }
Exemplo n.º 2
0
 private List <Pixel> FindBoundary(ITraceAlgorithm trace)
 {
     return(trace.Trace(_image));
 }