The color_transfer.hpp
header file is an OpenCV implementation based on Color Transfer
between Images [Reinhard et al., 2001] and Adrian Rosebrock repository (for Python). The algorithm requires only the mean and standard deviation of pixel intensities for each channel in the Lab* color space.
This is an C++ approach from the above methods, for more information I recommend the above article or Adrian's post on his blog.
- OpenCV
- boost/program_options*
*Optional - Used to get the input images from terminal
Just download this repository and use the header file color_transfer.hpp
contained in the color_transfer folder.
A example is in sample folder. After compiling it, run the code below
$ ./color_transfer -s ../images/sunset.jpg -t ../images/ocean_day.jpg
$ ./color_transfer -s ../images/autumn.jpg -t ../images/woods.jpg
$ ./color_transfer -s ../images/old_pic.jpg -t ../images/city.jpg
$ ./color_transfer -s ../images/florest_day.jpg -t ../images/florest_dark.jpg
xhost +local:docker
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker container run --rm -ti \
-e DISPLAY=$DISPLAY \
-v $XSOCK:$XSOCK \
-v $XAUTH:$XAUTH \
-e XAUTHORITY=$XAUTH \
-v /home/${USER}/${FOLDER}/:/lab/images/
hsneto/color_transfer ./transfer -s images/${src_image} -t images/${tgt_image} -p images/${output_image}
xhost -local:docker
- Humberto da Silva Neto - Initial work
- Adrian Rosebrock
- [Reinhard et al., 2001]