public static void main(String[] args) throws IOException
    {
        CommandLine cmd = getArgs(args);

        String path = cmd.getArgs()[0];

        System.out.printf("File: '%s'%n", path);

        BufferedImage image = ImageIO.read(new File(path));

        Collection<Circle> circles = CircleDetection.detect(image);

        BufferedImage output = CircleAdder.combine(image, circles);

        if (cmd.hasOption("preview"))
        {
            System.out.println("Rendering popup");
            PopUp.show(output, path);
        }
        if (cmd.hasOption("save"))
        {
            String outpath = cmd.getOptionValue("save");
            System.out.printf("Saving Image to '%s'%n", outpath);
            ImageWriter.save(output, outpath);
        }

        System.out.printf("Detected: %d circles: %n", circles.size());
        System.out.printf("%-10s | %-10s | %-10s%n", "X", "Y", "radius");
        for(Circle c : circles) System.out.printf("%10s | %10s | %10s%n", c.x, c.y, c.radius);

    }