Method BlobFromImages
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
BlobFromImages(IEnumerable<Mat>, double, Size, Scalar, bool, bool)
Creates 4-dimensional blob from series of images. Optionally resizes and crops @p images from center, subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.
public static Mat BlobFromImages(IEnumerable<Mat> images, double scaleFactor, Size size = default, Scalar mean = default, bool swapRB = true, bool crop = true)
Parameters
imagesIEnumerable<Mat>input images (all with 1- or 3-channels).
scaleFactordoublemultiplier for @p image values.
sizeSizespatial size for output image
meanScalarscalar with mean values which are subtracted from channels. Values are intended to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true.
swapRBboolflag which indicates that swap first and last channels in 3-channel image is necessary.
cropboolflag which indicates whether image will be cropped after resize or not
Returns
- Mat
4-dimansional Mat with NCHW dimensions order.
Remarks
if @p crop is true, input image is resized so one side after resize is equal to corresponing dimension in @p size and another one is equal or larger.Then, crop from the center is performed. If @p crop is false, direct resize without cropping and preserving aspect ratio is performed.