Mat1. MatMat original Imgcodecs.imread(input.jpg); // 加载原始图像Mat cloned original.clone(); // 对克隆副本进行操作原始图像不受影响original.release(); // 释放内存cloned.release();知识点 注意点同张图片 bitmap的宽高 与 mat的宽高 行列数量相等 bitmap.getWidth() matsrc.width(); bitmap.getHeight() matsrc.height();Bitmap bitmap mSurfaceView.readPicture(img_org); //读图片 Mat matsrc new Mat(); Log.e(TAG, run: bitmap.getWidth() bitmap.getHeight()); Utils.bitmapToMat(bitmap,matsrc); Log.e(TAG, run: matsrc.width() matsrc.height()); Log.e(TAG, run: matsrc.cols() matsrc.rows());