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

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

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

Utils.nBitmapToMat2介绍

暂无

代码示例

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

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

/**
 * Converts Android Bitmap to OpenCV Mat.
 * <p>
 * This function converts an Android Bitmap image to the OpenCV Mat.
 * <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
 * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
 * it keeps the image in RGBA format.
 * <br>This function throws an exception if the conversion fails.
 * @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 it may be empty.
 * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
 */
public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
  if (bmp == null)
    throw new java.lang.IllegalArgumentException("bmp == null");
  if (mat == null)
    throw new java.lang.IllegalArgumentException("mat == null");
  nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
}

相关文章