org.opencv.android.Utils.bitmapToMat()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(285)

本文整理了Java中org.opencv.android.Utils.bitmapToMat()方法的一些代码示例,展示了Utils.bitmapToMat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.bitmapToMat()方法的具体详情如下:
包路径:org.opencv.android.Utils
类名称:Utils
方法名:bitmapToMat

Utils.bitmapToMat介绍

[英]Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
[中]bitmapToMat的缩写形式(bmp、mat、false)。

代码示例

代码示例来源:origin: leadrien/opencv_native_androidstudio

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: KePeng1019/SmartPaperScan

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: hschott/Camdroid

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: akshika47/OpencvAndroid

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: raulh82vlc/Image-Detection-Samples

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: jtsky/EasyPR_Android

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: kongqw/OpenCVForAndroid

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: farkam135/GoIV

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: ytai/IOIOPlotter

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: abhn/marvel

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: tz28/Chinese-number-gestures-recognition

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: DuckDeck/AndroidDemo

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: imistyrain/EasyPR4Android

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: ctodobom/OpenCV-3.1.0-Android

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: SOFTPOWER1991/OpenCVCheck

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: SouvDc/face-detection

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: InnoFang/Android-Code-Demos

/**
 * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
 * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
 * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat) {
  bitmapToMat(bmp, mat, false);
}

代码示例来源:origin: SOFTPOWER1991/OpenCVCheck

@Override
  public void onClick(View v) {
    Mat mat1 = new Mat();
    Mat mat2 = new Mat();
    Mat mat11 = new Mat();
    Mat mat22 = new Mat();
    Utils.bitmapToMat(mBitmap1, mat1);
    Utils.bitmapToMat(mBitmap2, mat2);
    Imgproc.cvtColor(mat1, mat11, Imgproc.COLOR_BGR2GRAY);
    Imgproc.cvtColor(mat2, mat22, Imgproc.COLOR_BGR2GRAY);
    comPareHist(mat11, mat22);
  }
});

代码示例来源:origin: InnoFang/Android-Code-Demos

private void convertGray() {
  Mat src = new Mat();
  Mat temp = new Mat();
  Mat dst = new Mat();
  Utils.bitmapToMat(selectbp, src);
  Imgproc.cvtColor(src, temp, Imgproc.COLOR_BGRA2BGR);
  Log.i("CV", "image type:" + (temp.type() == CvType.CV_8UC3));
  Imgproc.cvtColor(temp, dst, Imgproc.COLOR_BGR2GRAY);
  Utils.matToBitmap(dst, selectbp);
  myImageView.setImageBitmap(selectbp);
}

代码示例来源:origin: tz28/Chinese-number-gestures-recognition

private Bitmap scaleImage(Bitmap bitmap, int width, int height)
{
  Mat src = new Mat();
  Mat dst = new Mat();
  Utils.bitmapToMat(bitmap, src);
  //new Size(width, height)
  Imgproc.resize(src, dst, new Size(width,height),0,0,Imgproc.INTER_AREA);
  Bitmap bitmap1 = Bitmap.createBitmap(dst.cols(),dst.rows(),Bitmap.Config.RGB_565);
  Utils.matToBitmap(dst, bitmap1);
  return bitmap1;
}

相关文章