// tiqu.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<opencv2/opencv.hpp>
#include "cxcore.h"
#include "highgui.h"
#include "cv.h"
#include <fstream>
#define MAXL 10000000
double d[MAXL][3];
using namespace std;
using namespace cv;
int main(int argc, char* argv[])
{
IplImage* img = cvLoadImage("D://tupian2.jpg",-1);
long t=0;
CvScalar p;
ofstream outfile("D:\\RGB.txt");
for(int i=0;i<img->width;i++)
{
for(int j=0;j<img->height;j++)
{
p = cvGet2D(img,i,j);//(j,i)
outfile<<p.val[0]<<" ";
outfile<<p.val[1]<<" ";
outfile<<p.val[2]<<" ";
outfile<<endl;
}
}
return 0;
}