static void Main1(string[] args) { ColorFloatImage image = ImageIO.FileToColorFloatImage(args[2]); ColorFloatImage output_image = gradient(image, "odd"); ImageIO.ImageToFile(output_image, args[3]); }
static void Main(string[] args) { GrayscaleFloatImage output_image = null; if (args[0] == "mse") { GrayscaleFloatImage image = ImageIO.FileToGrayscaleFloatImage(args[1]); GrayscaleFloatImage image1 = ImageIO.FileToGrayscaleFloatImage(args[2]); Console.WriteLine(MSE(image, image1)); } else if (args[0] == "psnr") { GrayscaleFloatImage image = ImageIO.FileToGrayscaleFloatImage(args[1]); GrayscaleFloatImage image1 = ImageIO.FileToGrayscaleFloatImage(args[2]); Console.WriteLine(PSNR(image, image1)); } else if (args[0] == "ssim") { GrayscaleFloatImage image = ImageIO.FileToGrayscaleFloatImage(args[1]); GrayscaleFloatImage image1 = ImageIO.FileToGrayscaleFloatImage(args[2]); Console.WriteLine(SSIM(image, image1)); } else if (args[0] == "mssim") { GrayscaleFloatImage image = ImageIO.FileToGrayscaleFloatImage(args[1]); GrayscaleFloatImage image1 = ImageIO.FileToGrayscaleFloatImage(args[2]); Console.WriteLine(MSSIM(image, image1)); } else if (args[0] == "dir") { ColorFloatImage image = ImageIO.FileToColorFloatImage(args[2]); image = gauss(image, "even", (float)Convert.ToDouble(args[1])); output_image = dir(image); ImageIO.ImageToFile(output_image, args[3]); } else if (args[0] == "nonmax") { ColorFloatImage image = ImageIO.FileToColorFloatImage(args[2]); image = gauss(image, "even", (float)Convert.ToDouble(args[1])); output_image = nonmax(image); ImageIO.ImageToFile(output_image, args[3]); } else if (args[0] == "canny") { ColorFloatImage image = ImageIO.FileToColorFloatImage(args[4]); image = gauss(image, "even", (float)Convert.ToDouble(args[1])); output_image = canny(image, Convert.ToInt32(args[2]), Convert.ToInt32(args[3])); ImageIO.ImageToFile(output_image, args[5]); } }