| 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
)
Public Shared Function BlobFromImages (
images As IEnumerable(Of Mat),
scaleFactor As Double,
Optional size As Size = Nothing,
Optional mean As Scalar = Nothing,
Optional swapRB As Boolean = true,
Optional crop As Boolean = true
) As Mat
public:
static Mat^ BlobFromImages(
IEnumerable<Mat^>^ images,
double scaleFactor,
Size size = nullptr,
Scalar mean = nullptr,
bool swapRB = true,
bool crop = true
)
static member BlobFromImages :
images : IEnumerable<Mat> *
scaleFactor : float *
?size : Size *
?mean : Scalar *
?swapRB : bool *
?crop : bool
(* Defaults:
let _size = defaultArg size null
let _mean = defaultArg mean null
let _swapRB = defaultArg swapRB true
let _crop = defaultArg crop true
*)
-> Mat
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:
Mat4-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