/// <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); }
private List <Pixel> FindBoundary(ITraceAlgorithm trace) { return(trace.Trace(_image)); }