

Import important Libraries: import numpy as np import matplotlib.pyplot as plt import cv2ĭefine Image to be colorized: IMAGE = "soldiers_1941" Let’s follow the steps to colorize a BT&W photo: Adrian Rosebrok, that was the inspiration and guide for this project. I also recommend that you review the great tutorial “ Black and white image colorization with OpenCV and Deep Learning” by Dr.
Colorize video software download#
I recommend that you follow my explanation, but if you want, you can go and download the notebooks and test photos from my GitHub: We will describe step by step all the process of colorization using Jupyter Notebooks. I will assume that you have Python (version 3.6) and OpenCV (4.0) installed in your machine. colorization_release_v2_norebal.caffemodel.Go to Zhang et al - Colorful Image Colorization - models and download the 3 files and load them at the created subfolder “/model”.

Under this main created directory, let’s create sub-folders: The first thing to do is to organize an environment where we will work. For simplicity let’s split in two: “L” and “a+b” as shown in the block diagram: In other words, millions of color photos were decomposed using Lab model and used as an input feature (“L”) and classification labels (“a” and “b”). The AI (Deep Learning) ProcessĪs commented on the introduction, the Artificial Intelligent (AI) approach is implemented as a feed-forward pass in a CNN (“ Convolutional Neural Network”) at test time and is trained on over a million color images. The L component is exactly what is used as input of the AI model, that was train to estimate the remained components, “a” and “b”. It aspires to perceptual uniformity, and its L component closely matches human perception of lightness. Unlike the RGB color model, Lab color is designed to approximate human vision. CIELAB was designed to be perceptually uniform with respect to human color vision, meaning that the same amount of numerical change in these values corresponds to about the same amount of visually perceived change. The color space L * a * b * was created after the theory of opposing colors, where two colors cannot be green and red at the same time, or yellow and blue at the same time. It expresses color as three numerical values, L* for the lightness and a* and b* for the green–red and blue-yellow color components. The CIELAB color space (also known as CIE L*a*b* or sometimes abbreviated as simply “Lab” color space) is a color space defined by the International Commission on Illumination (CIE) in 1976. But, the model that will be used on this project is the “Lab”.
