版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
(VS2013+Opencv3.0)
结合前一篇颜色判别之RES判别法理论的编码实现:
h文件#include#includeusing namespace cv; using namespace std; class Res { public:	double Res::readregx();	double Res::readthd();	double detect(cv::Mat, int i, double r, double g, double b);	Mat sum(Mat summat);	Mat sqrtD(Mat sqrtd);	Mat ptMulti(Mat X1, Mat X2); };cpp文件:
#include “Res.h”double Res::detect(cv::Mat reg, int i, double r, double g, double b) {	int row = 0;//有几行,即几个参数	for (int j = 0; j