/// <summary> /// processes the /// </summary> private static bool ProcessImage() { try { // Open an Image file, and get its bitmap Image myImage = Image.FromFile(inputfile); var bitmap = new Bitmap(myImage); var edgeImage = GetEdgeImage(bitmap); var ho = new Hough_Operator(ImageDiagonalSize(bitmap)); var max = ho.Operate(edgeImage, bitmap.Width, bitmap.Height); //get the threshold value for what local max is var localmax = (int)(max * .9); ho.DrawLines(bitmap, localmax, outputfile); Write(String.Format("File: {0} generated ok.", outputfile)); return(true); } catch (Exception e) { Write(String.Format("Exception thrown: {0}", e.Message)); return(false); } }
/// <summary> /// processes the /// </summary> private static bool ProcessImage() { try { // Open an Image file, and get its bitmap Image myImage = Image.FromFile(inputfile); var bitmap = new Bitmap(myImage); var edgeImage = GetEdgeImage(bitmap); var ho = new Hough_Operator(ImageDiagonalSize(bitmap)); var max = ho.Operate(edgeImage, bitmap.Width, bitmap.Height); //get the threshold value for what local max is var localmax = (int) (max*.9); ho.DrawLines(bitmap, localmax, outputfile); Write(String.Format("File: {0} generated ok.", outputfile)); return true; } catch (Exception e) { Write(String.Format("Exception thrown: {0}", e.Message)); return false; } }