/// <summary>
///
/// </summary>
/// <param name="red">A grayscale image filtered using a redness algorithm</param>
/// <param name="startAt">The maximum brightness point, the place to start filling</param>
/// <param name="origin">The origin of the search, usually the click</param>
/// <param name="maxRadius">The maximum distance from 'startAt' to consider filling</param>
public AdaptiveCircleFill(UnmanagedImage red, System.Drawing.Point startAt, PointF origin, float maxRadius)
{
this.red = red;
this.StartAt = startAt;
MaxValue = red.Collect8bppPixelValues(new List<AForge.IntPoint>(new AForge.IntPoint[] { new AForge.IntPoint(startAt.X, startAt.Y) }))[0];
//Set the min threshold to 4/10ths the starting point's value
MinValue = (byte)Math.Round(0.4 * (double)MaxValue);
MinValue = Math.Max((byte)50, MinValue);
//Apply some arbitrary values...
this.Origin = origin;
this.MaxRadius = maxRadius;
OriginStartOffset = Math.Sqrt((origin.X - StartAt.X) * (origin.X - StartAt.X) + (origin.Y - StartAt.Y) * (origin.Y - StartAt.Y));
}