转换公式
按照如下转换公式利用opencv编写代码。
运行环境win10+opencv2.4.9+VS2015
#include "stdafx.h"
#include<opencv2/opencv.hpp>
#include<iostream>
#include<math.h>
#include<math.h>
#include<complex>
using namespace std;
using namespace cv;
Mat BGR2YCbCr(Mat img, Mat out)
{
int width = img.rows;
int height = img.cols;
//cv::Mat out = cv::Mat::zeros(height, width, CV_32F);
for (int j = 0; j < width ; j++) {
for (int i = 0; i < height; i++) {
// Y
out.at<cv::Vec3b>(j, i)[0] =