==============================================
版权所有:小熊不去实验室优快云博客
==============================================
怀旧色调色原理
#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 rng;
Mat img(src.size(),CV_8UC3);
for (int y=0; y<heigh; y++)
{
uchar* P0 = src.ptr<uchar>(y);
uchar* P1 = img.ptr<uchar>(y);
for (int x=0; x<width; x++)
{
float B=P0[3*x];
float G=P0[3*x+1];
float R=P0[3*x+2];
float newB=0.272*R+0.534*G+0.131*B;
float newG=0.349*R+0.686*G+0.168*B;
float newR=0.393*R+0.769*G+0.189*B;
if(