Tim M 57b5cefde5 Updated all `.md` files to contain newest image 2 år sedan
..
LICENSE 559a0bc1c3 colorization code 6 år sedan
README.md 57b5cefde5 Updated all `.md` files to contain newest image 2 år sedan
colorizeImage.cpp 488723de0b added GPU usage 4 år sedan
colorizeImage.py 488723de0b added GPU usage 4 år sedan
colorizeVideo.cpp 488723de0b added GPU usage 4 år sedan
colorizeVideo.py 488723de0b added GPU usage 4 år sedan
getModels.sh 559a0bc1c3 colorization code 6 år sedan
greyscaleImage.png d166ab2bc2 sample image name changes 6 år sedan
greyscaleVideo.mp4 d166ab2bc2 sample image name changes 6 år sedan

README.md

CNN based Image Colorization using OpenCV

This repository contains code for the blog post Convolutional Neural Network, CNN based Image Colorization using OpenCV.

CNN based Image Colorization

download

Usage

Run the getModels.sh file from command line to download the needed model files

sudo chmod a+x getModels.sh
./getModels.sh

Python: Commandline usage to colorize a single image:

python3 colorizeImage.py --input greyscaleImage.png

a video file:

python3 colorizeVideo.py --input greyscaleVideo.mp4

C++:

Compilation examples

g++ pkg-config --cflags --libs opencv4 colorizeImage.cpp -o colorizeImage.out -lopencv_core -lopencv_dnn -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -std=c++11 g++ pkg-config --cflags --libs opencv4 colorizeVideo.cpp -o colorizeVideo.out -lopencv_core -lopencv_dnn -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio -std=c++11

Commandline usage to colorize

a single image:

./colorizeImage.out greyscaleImage.png

a video file:

./colorizeVideo.out greyscaleVideo.mp4

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.