Click or drag to resize

CvDnnBlobFromImages Method

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.

Namespace:  OpenCvSharp.Dnn
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public static Mat BlobFromImages(
	IEnumerable<Mat> images,
	double scaleFactor,
	Size size = null,
	Scalar mean = null,
	bool swapRB = true,
	bool crop = true
)

Parameters

images
Type: System.Collections.GenericIEnumerableMat
input images (all with 1- or 3-channels).
scaleFactor
Type: SystemDouble
multiplier for @p image values.
size (Optional)
Type: OpenCvSharpSize
spatial size for output image
mean (Optional)
Type: OpenCvSharpScalar
scalar 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.
swapRB (Optional)
Type: SystemBoolean
flag which indicates that swap first and last channels in 3-channel image is necessary.
crop (Optional)
Type: SystemBoolean
flag which indicates whether image will be cropped after resize or not

Return Value

Type: 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.
See Also