#include<iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main( int argc, char** argv )
{
float a[18] = {
30,60,45,56,70,78,
90,80,94,89,87,91,
78,76,56,43,21,10 };
CvMat mat;
cvInitMatHeader(&mat,3, 2, CV_32FC3,a); //创建一个空矩阵
for(int y = 0; y <mat.rows; y++)
{
for(int x = 0; x <mat.cols; x++)
{
CvScalar value = cvGet2D(&mat, y, x);
printf("(%f %f %f )",value.val[0],value.val[1],value.val[2]);
}
printf("\n");
}
return 0;
}