{{indexmenu_n>4}} ====== Colorization ====== 自動色付けのサンプル.親切にソースコード内に必要な情報が既に記述されているので,こちらを参照することで すぐに実行環境作れます. * ソースコードへのリンク:https://github.com/opencv/opencv/blob/master/samples/dnn/colorization.cpp * OFでの実装:https://github.com/TetsuakiBaba/ofxOpenCvDnnColorization int main(int argc, char **argv) { const string about = "This sample demonstrates recoloring grayscale images with dnn.\n" "This program is based on:\n" " http://richzhang.github.io/colorization\n" " https://github.com/richzhang/colorization\n" "Download caffemodel and prototxt files:\n" " http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel\n" " https://raw.githubusercontent.com/richzhang/colorization/master/colorization/models/colorization_deploy_v2.prototxt\n"; const string keys = "{ h help | | print this help message }" "{ proto | colorization_deploy_v2.prototxt | model configuration }" "{ model | colorization_release_v2.caffemodel | model weights }" "{ image | space_shuttle.jpg | path to image file }" "{ opencl | | enable OpenCL }"; * {{:opencv_dnn:monochrome.jpg?400|}} * 引用:https://pixabay.com/ja/モノクロ-黒と白-風景-古典的な-国-農村-風光明媚な-1445311/ $ ./example_dnn_colorization --proto=colorization_deploy_v2.prototxt --model=colorization_release_v2.caffemodel --image=monochrome.jpg * 実行結果 * {{:opencv_dnn:monochrome_2.png?400|}}