Mat me = (Mat_<float>(4, 4) << 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1);
    Mat meinv = me.inv();
    cout << "me=\n" << me << endl;
    cout << "meinv=" << endl << meinv << endl << endl;

    int nonZerosNum = countNonZero(me);
    cout << "me = " << endl << me << endl;
    cout << "me中非零元素的个数=" << nonZerosNum << endl;
    //均值和方差
    Mat mean;
    Mat stddev(1,1,CV_8UC1);
    meanStdDev(me, mean, stddev);
    Mat_<uchar>img = stddev;//Mat_是Mat的派生类.
                            //优点:Mat_对象访问元素时不再需要指定元素类型;而Mat类型对象需要在<>中指定元素类型,如用img.at<类型>(i,j)。
    img(0,0) = 100;
    cout << "mean=" << mean << endl << endl;
    cout << "stddev=" << stddev << endl << endl;

    cout << "stddev=" <<int(img(0,0)) << endl << endl;