========================================================== ======
Copyright: bear does not go to the lab csdn blog
========================================================== ======
Principles of old colors
# Include <opencv/cv. h> # include <opencv/highgui. h> using namespace CV; using namespace STD; int main () {mat src = imread ("D:/scene04.jpg", 1); int width = SRC. cols; int heigh = SRC. rows; RNG; mat img (SRC. size (), cv_8uc3); For (INT y = 0; y
Source image:
Old colors:
Links:
The effect of the comic picture is similar to that of the image after the grayscale image. They are all grayscale images, but the comic picture increases the contrast of the image and improves the overall brightness and brightness. algorithm:
R = |g – b + g + r| * r / 256
G = |b – g + b + r| * r / 256;
B = |b – g + b + r| * g / 256;
# Include <math. h> # include <opencv/cv. h> # include <opencv/highgui. h> using namespace CV; using namespace STD; int main () {mat src = imread ("D:/scene04.jpg", 1); int width = SRC. cols; int heigh = SRC. rows; RNG; mat img (SRC. size (), cv_8uc3); For (INT y = 0; y
Comic effect:
Casting Algorithm
R = r * 128/(g + B + 1 );
G = g * 128/(R + B + 1 );
B = B * 128/(g + R + 1 );
Freezing Algorithm
R = (r-g-B) * 3/2;
G = (G-r-B) * 3/2;
B = (B-G-r) * 3/2;
# Include <math. h> # include <opencv/cv. h> # include <opencv/highgui. h> # define maxsize (32768) using namespace CV; using namespace STD; void casting (const mat & SRC) {mat IMG; SRC. copyto (IMG); int width = SRC. cols; int heigh = SRC. rows; mat dst (IMG. size (), cv_8uc3); For (INT y = 0; y
Casting:
Frozen: