Beispiel #1
0
    binarize_flag = False
    #画像データの反転用フラグ
    reverse_flag = False
    #各種画像を表示するフラグ
    show_flag = False
    #画像のぼかし処理の回数
    blur_times = 0
    if args.binarize:
        binarize_flag = True
    if args.reverse:
        reverse_flag = True
    if args.show:
        show_flag = True
    if args.time:
        blur_times = 0 if not type(args.time) == int else args.time

    img_path = args.image_file_path
    size = args.picross_size

    #画像を0と255の二値データに変換
    img_processor = ImageProcessing(img_path, blur_times, size, 0.001)
    img_processor.set_flags(binarize_flag, reverse_flag, show_flag)
    mosaic_img = img_processor.convert_mosaic()

    #ピクロスの生成と描画処理
    picross_processor = PicrossProcessing(mosaic_img, 11)
    picross_processor.draw_main()

    cv2.waitKey(0)
    cv2.destroyAllWindows()