参考来源:
// define head function
#ifndef PS_ALGORITHM_H_INCLUDED
#define PS_ALGORITHM_H_INCLUDED
#include
#include
#include "cv.h"
#include "highgui.h"
#include "cxmat.hpp"
#include "cxcore.hpp"
#include "math.h"
using namespace std;
using namespace cv;
void Show_Image(Mat&, const string &);
#endif // PS_ALGORITHM_H_INCLUDED
/*
This program will generate
color gradient mapping
*/
#include "PS_Algorithm.h"
#include
using namespace std;
using namespace cv;
int main(void)
{
Mat Img(600, 800, CV_32FC3);
Scalar a(255.0, 255.0, 255.0);
Scalar b(0.0, 0.0, 0.0);
Img.setTo(a);
int width, height;
width=Img.cols;
h