OpenCV
4.9.0
Open Source Computer Vision
|
Processing params of image to blob. More...
#include <opencv2/dnn/dnn.hpp>
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. More... | |
Rect | blobRectToImageRect (const Rect &rBlob, const Size &size) |
Get rectangle coordinates in original image system from rectangle in blob coordinates. More... | |
Public Attributes | |
Scalar | borderValue |
Value used in padding mode for padding. More... | |
DataLayout | datalayout |
Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC. More... | |
int | ddepth |
Depth of output blob. Choose CV_32F or CV_8U. More... | |
Scalar | mean |
Scalar with mean values which are subtracted from channels. More... | |
ImagePaddingMode | paddingmode |
Image padding mode. More... | |
Scalar | scalefactor |
scalefactor multiplier for input image values. More... | |
Size | size |
Spatial size for output image. More... | |
bool | swapRB |
Flag which indicates that swap first and last channels. More... | |
Processing params of image to blob.
It includes all possible image processing operations and corresponding parameters.
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. cv::dnn::Image2BlobParams::Image2BlobParams | ( | ) |
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 |
||
) |
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.
rBlob | rect in blob coordinates. |
rImg | result rect in image coordinates. |
size | original input image size. |
Get rectangle coordinates in original image system from rectangle in blob coordinates.
rBlob | rect in blob coordinates. |
size | original input image size. |
Scalar cv::dnn::Image2BlobParams::borderValue |
Value used in padding mode for padding.
DataLayout cv::dnn::Image2BlobParams::datalayout |
Order of output dimensions. Choose DNN_LAYOUT_NCHW or DNN_LAYOUT_NHWC.
int cv::dnn::Image2BlobParams::ddepth |
Depth of output blob. Choose CV_32F or CV_8U.
Scalar cv::dnn::Image2BlobParams::mean |
Scalar with mean values which are subtracted from channels.
ImagePaddingMode cv::dnn::Image2BlobParams::paddingmode |
Image padding mode.
Scalar cv::dnn::Image2BlobParams::scalefactor |
scalefactor multiplier for input image values.
Size cv::dnn::Image2BlobParams::size |
Spatial size for output image.
bool cv::dnn::Image2BlobParams::swapRB |
Flag which indicates that swap first and last channels.