OpenCV  5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cv::dnn::Image2BlobParams Struct Reference

Processing params of image to blob. More...

#include <opencv2/dnn/dnn.hpp>

Collaboration diagram for cv::dnn::Image2BlobParams:

Public Member Functions

 Image2BlobParams ()
 
 Image2BlobParams (const Scalar &scalefactor, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, int ddepth=CV_32F, DataLayout datalayout=DNN_LAYOUT_NCHW, ImagePaddingMode mode=DNN_PMODE_NULL, Scalar borderValue=0.0)
 
void blobRectsToImageRects (const std::vector< Rect > &rBlob, std::vector< Rect > &rImg, const Size &size)
 Get rectangle coordinates in original image system from rectangle in blob coordinates.
 
Rect blobRectToImageRect (const Rect &rBlob, const Size &size)
 Get rectangle coordinates in original image system from rectangle in blob coordinates.
 

Public Attributes

Scalar borderValue
 Value used in padding mode for padding.
 
DataLayout datalayout
 Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.
 
int ddepth
 Depth of output blob. Choose CV_32F or CV_8U.
 
Scalar mean
 Scalar with mean values which are subtracted from channels.
 
ImagePaddingMode paddingmode
 Image padding mode.
 
Scalar scalefactor
 scalefactor multiplier for input image values.
 
Size size
 Spatial size for output image.
 
bool swapRB
 Flag which indicates that swap first and last channels.
 

Detailed Description

Processing params of image to blob.

It includes all possible image processing operations and corresponding parameters.

See also
blobFromImageWithParams
Note
The order and usage of scalefactor and mean are (input - mean) * scalefactor. The order and usage of scalefactor, size, mean, swapRB, and ddepth are consistent with the function of blobFromImage.

Constructor & Destructor Documentation

◆ Image2BlobParams() [1/2]

cv::dnn::Image2BlobParams::Image2BlobParams ( )

◆ Image2BlobParams() [2/2]

cv::dnn::Image2BlobParams::Image2BlobParams ( const Scalar scalefactor,
const Size size = Size(),
const Scalar mean = Scalar(),
bool  swapRB = false,
int  ddepth = CV_32F,
DataLayout  datalayout = DNN_LAYOUT_NCHW,
ImagePaddingMode  mode = DNN_PMODE_NULL,
Scalar  borderValue = 0.0 
)

Member Function Documentation

◆ blobRectsToImageRects()

void cv::dnn::Image2BlobParams::blobRectsToImageRects ( const std::vector< Rect > &  rBlob,
std::vector< Rect > &  rImg,
const Size size 
)

Get rectangle coordinates in original image system from rectangle in blob coordinates.

Parameters
rBlobrect in blob coordinates.
rImgresult rect in image coordinates.
sizeoriginal input image size.

◆ blobRectToImageRect()

Rect cv::dnn::Image2BlobParams::blobRectToImageRect ( const Rect rBlob,
const Size size 
)

Get rectangle coordinates in original image system from rectangle in blob coordinates.

Parameters
rBlobrect in blob coordinates.
sizeoriginal input image size.
Returns
rectangle in original image coordinates.

Member Data Documentation

◆ borderValue

Scalar cv::dnn::Image2BlobParams::borderValue

Value used in padding mode for padding.

◆ datalayout

DataLayout cv::dnn::Image2BlobParams::datalayout

Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.

◆ ddepth

int cv::dnn::Image2BlobParams::ddepth

Depth of output blob. Choose CV_32F or CV_8U.

◆ mean

Scalar cv::dnn::Image2BlobParams::mean

Scalar with mean values which are subtracted from channels.

◆ paddingmode

ImagePaddingMode cv::dnn::Image2BlobParams::paddingmode

Image padding mode.

See also
ImagePaddingMode.

◆ scalefactor

Scalar cv::dnn::Image2BlobParams::scalefactor

scalefactor multiplier for input image values.

◆ size

Size cv::dnn::Image2BlobParams::size

Spatial size for output image.

◆ swapRB

bool cv::dnn::Image2BlobParams::swapRB

Flag which indicates that swap first and last channels.


The documentation for this struct was generated from the following file: