Mat cur_img = imread(ph, IMREAD_GRAYSCALE);
        cout << cur_img.cols << "  " << cur_img.rows;


        for (int i = 0; i < picture_height; i++) {
            uchar* data = cur_img.ptr<uchar>(i);  //获取第i行的首地址
            for (int j = 0; j < picture_width; j++) { 
                int res = data[j];
                cout << "cur_data=" << res <<endl;
            }
        }
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐