/* #define cvAbs( src, dst ) cvAbsDiffS( (src), (dst), cvScalarAll(0)) cvAbsDiffS( const CvArr* srcarr1, CvArr* dstarr, CvScalar scalar ) {     cv::Mat src1 = cv::cvarrToMat(srcarr1), dst = cv::cvarrToMat(dstarr);     CV_Assert( src1.size() == dst.size() && src1.type() == dst.type() );      cv::absdiff( src1, scalar, dst ); }  CV_EXPORTS void absdiff(const Mat& a, const Mat& b, Mat& c); CV_EXPORTS void absdiff(const Mat& a, const Scalar& s, Mat& c);   /****************************************************************************************\ *                                      absdiff                                           * \****************************************************************************************/ /* template struct OpAbsDiff {     typedef T type1;     typedef T type2;     typedef T rtype;     T operator()(T a, T b) { return (T)std::abs(a - b); } };  template<> inline short OpAbsDiff::operator ()(short a, short b) { return saturate_cast(std::abs(a - b)); }  template struct OpAbsDiffS {     typedef T type1;     typedef WT type2;     typedef T rtype;     T operator()(T a, WT b) { return saturate_cast(std::abs(a - b)); } };  void absdiff( const Mat& src1, const Mat& src2, Mat& dst ) {     static BinaryFunc tab[] =     {         binaryOpC1_,VAbsDiff8u>, 0,         binaryOpC1_,VAbsDiff16u>,         binaryOpC1_,VAbsDiff16s>,         binaryOpC1_,NoVec>,         binaryOpC1_,VAbsDiff32f>,         binaryOpC1_,NoVec>, 0     };      dst.create(src1.size(), src1.type());     BinaryFunc func = tab[src1.depth()];     CV_Assert(src1.size() == src2.size() && src1.type() == src2.type() && func != 0);     func( src1, src2, dst ); }   void absdiff( const Mat& src1, const Scalar& s, Mat& dst ) {     static BinarySFuncCn tab[] =     {         binarySOpCn_ >, 0,         binarySOpCn_ >,         binarySOpCn_ >,         binarySOpCn_ >,         binarySOpCn_ >,         binarySOpCn_ >, 0     };      dst.create(src1.size(), src1.type());     BinarySFuncCn func = tab[src1.depth()];     CV_Assert(src1.channels() <= 4 && func != 0);     func( src1, dst, s ); } */


#include "stdafx.h" #include  #include  #include  #include  using namespace std; int main( int argc, char** argv ) {   	CvMat *mat; 	mat=cvCreateMat(3,4,CV_32FC1); 	 	float value = 0.0; 	int i = 0, j = 0; 	cout<<"初始化原始数组"<