Is it possible to calculate the values YUV of a graycale image ?
I found an article that confuses me: Interactive Image Colorization and Recoloring based on Coupled Map Lattices. In which the authors propose an algorithm to color and recolor an image.
For colorization, they color grayscale images. The user scribble some regions of the image with the desired color which spreads itself automatically by the algorithm.
They use YUV
color space to compare the values of Y
between the current pixel and its neighbors. If the Y
value of a neighbor is stronger than the current pixel sets its U
and V
values to those of the neighbor (attacker).
My problem: how can I cancluate the YUV
values of a given pixel of a grayscale image ?
Or may be a better question: how do they compare in that article the valyes of UV of each pixel since they set them to 0 (grayscale) in the start ?
These are three questions in one:
Is it possible to calculate the values YUV of a graycale image?
Yes.
My problem: how can I cancluate the YUV values of a given pixel of a grayscale image?
You could treat your grayscale image as a RGB image and then convert that to YUV:
cv::Mat1b image;
cv::Mat3b image_BGR, image_YUV;
cv::cvtColor( image, image_BGR, COLOR_GRAY2BGR );
cv::cvtColor( image_BGR, image_YUV, COLOR_BGR2YUV );
Or may be a better question: how do they compare in that article the valyes of UV of each pixel since they set them to 0 (grayscale) in the start?
I suggest you post that question as a separate question (and add a link to the PDF of the paper).