blobFromImages function

Mat blobFromImages(
  1. VecMat images, {
  2. Mat? blob,
  3. double scalefactor = 1.0,
  4. (int, int) size = (0, 0),
  5. Scalar? mean,
  6. bool swapRB = false,
  7. bool crop = false,
  8. int ddepth = MatType.CV_32F,
})

Creates 4-dimensional blob from series of images. Optionally resizes and crops images from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels. https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga0b7b7c3c530b747ef738178835e1e70f

Implementation

Mat blobFromImages(
  VecMat images, {
  Mat? blob,
  double scalefactor = 1.0,
  (int, int) size = (0, 0),
  Scalar? mean,
  bool swapRB = false,
  bool crop = false,
  int ddepth = MatType.CV_32F,
}) {
  blob ??= Mat.empty();
  mean ??= Scalar.zeros;
  cvRun(
    () => cdnn.Net_BlobFromImages(
      images.ref,
      blob!.ref,
      scalefactor,
      size.cvd.ref,
      mean!.ref,
      swapRB,
      crop,
      ddepth,
    ),
  );
  return blob;
}