OpenCV  5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
Enumerations | Functions

Detailed Description

Enumerations

enum  cv::cann::InterpolationFlags {
  cv::cann::INTER_NEAREST = 0 ,
  cv::cann::INTER_LINEAR = 1 ,
  cv::cann::INTER_CUBIC = 2 ,
  cv::cann::INTER_AREA = 3 ,
  cv::cann::INTER_MAX = 7
}
 interpolation algorithm More...
 

Functions

void cv::cann::copyMakeBorder (const AscendMat &src, AscendMat &dst, int top, int bottom, int left, int right, int borderType, const Scalar &value=Scalar())
 
void cv::cann::copyMakeBorder (const InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar &value=Scalar())
 Forms a border and fills it with specified bordertype around the copy of input image.
 
AscendMat cv::cann::crop (const AscendMat &src, const Rect &rect, AscendStream &stream=AscendStream::Null())
 
AscendMat cv::cann::crop (InputArray src, const Rect &rect, AscendStream &stream=AscendStream::Null())
 crop a 2D array. The function crops the matrix by given cv::Rect. Output matrix must be of the same depth as input one, size is specified by given rect size.
 
void cv::cann::cropResize (const AscendMat &src, AscendMat &dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation)
 
void cv::cann::cropResize (const InputArray src, OutputArray dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation)
 crop a sub image from a big one, and resize it to certain size.
 
void cv::cann::cropResizeMakeBorder (const AscendMat &src, AscendMat &dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation, int top, int left, const int borderType, Scalar value=Scalar())
 
void cv::cann::cropResizeMakeBorder (const InputArray src, OutputArray dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation, int top, int left, const int borderType, Scalar value=Scalar())
 crop a sub image from a big one, resize it to certain size, and form the top/left border and fills it with specified bordertype.
 
void cv::cann::flip (const AscendMat &src, AscendMat &dst, int flipCode, AscendStream &stream=AscendStream::Null())
 
void cv::cann::flip (InputArray src, OutputArray dst, int flipCode, AscendStream &stream=AscendStream::Null())
 Flips a 2D matrix around vertical, horizontal, or both axes.
 
void cv::cann::merge (const AscendMat *src, size_t n, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 Makes a multi-channel matrix out of several single-channel matrices.
 
void cv::cann::merge (const AscendMat *src, size_t n, OutputArray &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::merge (const std::vector< AscendMat > &src, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::merge (const std::vector< AscendMat > &src, OutputArray &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::resize (const AscendMat &src, AscendMat &dst, Size dsize, double fx, double fy, int interpolation, AscendStream &stream=AscendStream::Null())
 
void cv::cann::resize (InputArray src, OutputArray dst, Size dsize, double fx, double fy, int interpolation, AscendStream &stream=AscendStream::Null())
 Resizes an image src down to or up to the specified size.
 
void cv::cann::rotate (const AscendMat &src, AscendMat &dst, int rotateMode, AscendStream &stream=AscendStream::Null())
 
void cv::cann::rotate (InputArray src, OutputArray dst, int rotateCode, AscendStream &stream=AscendStream::Null())
 Rotates a 2D array in multiples of 90 degrees. The function cv::rotate rotates the array in one of three different ways: Rotate by 90 degrees clockwise (rotateCode = ROTATE_90_CLOCKWISE). Rotate by 180 degrees clockwise (rotateCode = ROTATE_180). Rotate by 270 degrees clockwise (rotateCode = ROTATE_90_COUNTERCLOCKWISE).
 
void cv::cann::split (const AscendMat &src, AscendMat *dst, AscendStream &stream=AscendStream::Null())
 Copies each plane of a multi-channel matrix into an array.
 
void cv::cann::split (const AscendMat &src, std::vector< AscendMat > &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::split (const InputArray src, AscendMat *dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::split (const InputArray src, std::vector< AscendMat > &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::transpose (const AscendMat &src, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 
void cv::cann::transpose (InputArray src, OutputArray dst, AscendStream &stream=AscendStream::Null())
 Transposes a matrix.
 

Enumeration Type Documentation

◆ InterpolationFlags

#include <opencv2/cann_interface.hpp>

interpolation algorithm

Enumerator
INTER_NEAREST 

nearest neighbor interpolation

INTER_LINEAR 

bilinear interpolation

INTER_CUBIC 

bicubic interpolation

INTER_AREA 

resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.

INTER_MAX 

mask for interpolation codes

Function Documentation

◆ copyMakeBorder() [1/2]

void cv::cann::copyMakeBorder ( const AscendMat src,
AscendMat dst,
int  top,
int  bottom,
int  left,
int  right,
int  borderType,
const Scalar value = Scalar() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ copyMakeBorder() [2/2]

void cv::cann::copyMakeBorder ( const InputArray  src,
OutputArray  dst,
int  top,
int  bottom,
int  left,
int  right,
int  borderType,
const Scalar value = Scalar() 
)

#include <opencv2/cann_interface.hpp>

Forms a border and fills it with specified bordertype around the copy of input image.

Parameters
srcSource image.
dstDestination image of the same type as src and the size Size(src.cols+left+right, src.rows+top+bottom).
topNumber of pixels for top padding
bottomNumber of pixels for bottom padding
leftNumber of pixels for left padding
rightNumber of pixels for right padding Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs to be built.
borderTypeBorder type. only cv::BorderTypes::BORDER_CONSTANT and cv::BorderTypes::BORDER_REPLICATE are supported.
valueBorder BGR or YUV value if borderType==BORDER_CONSTANT.
Note
The input images must be uint8, and only GRAY and BGR images are supported. The resolution of input and output images must in range of [10*6, 4096*4096].
Only the following devices are supported: Atlas Inference Series products, Atlas 200/500 A2 Inference products and Atlas A2 Training Series products/Atlas 300I A2 Inference products.
See also
cv::copyMakeBorder, cv::borderInterpolate

◆ crop() [1/2]

AscendMat cv::cann::crop ( const AscendMat src,
const Rect rect,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ crop() [2/2]

AscendMat cv::cann::crop ( InputArray  src,
const Rect rect,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

crop a 2D array. The function crops the matrix by given cv::Rect. Output matrix must be of the same depth as input one, size is specified by given rect size.

Parameters
srcinput array.
recta rect to crop a array to
streamAscendStream for the asynchronous version.
See also
cv::gapi::crop

◆ cropResize() [1/2]

void cv::cann::cropResize ( const AscendMat src,
AscendMat dst,
const Rect rect,
Size  dsize,
double  fx,
double  fy,
int  interpolation 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ cropResize() [2/2]

void cv::cann::cropResize ( const InputArray  src,
OutputArray  dst,
const Rect rect,
Size  dsize,
double  fx,
double  fy,
int  interpolation 
)

#include <opencv2/cann_interface.hpp>

crop a sub image from a big one, and resize it to certain size.

Parameters
srcinput array.
dstoutput array. it has the size dsize (when it is non-zero) or the size computed from src.size(), fx, and fy; the type of dst is the same as of src.
recta rect to crop a array to
dsizeoutput image size; if it equals zero, it is computed as cv::resize do.
fxscale factor along the horizontal axis; when it equals 0, it is computed as

\[(𝚍𝚘𝚞𝚋𝚕𝚎)𝚍𝚜𝚒𝚣𝚎.𝚠𝚒𝚍𝚝𝚑/𝚜𝚛𝚌.𝚌𝚘𝚕𝚜\]

fyscale factor along the vertical axis; when it equals 0, it is computed as

\[(𝚍𝚘𝚞𝚋𝚕𝚎)𝚍𝚜𝚒𝚣𝚎.𝚑𝚎𝚒𝚐𝚑𝚝/𝚜𝚛𝚌.𝚛𝚘𝚠𝚜\]

interpolationinterpolation method, only support INTER_NEAREST and INTER_LINEAR here. (see cv.cann.InterpolationFlags)
Note
The input images must be uint8, and only GRAY and BGR images are supported. The resolution of input and output images must in range of [10*6, 4096*4096].
Only the following devices are supported: Atlas Inference Series products, Atlas 200/500 A2 Inference products and Atlas A2 Training Series products/Atlas 300I A2 Inference products.
See also
cv::gapi::crop, cv::resize, cv::cann::resize

◆ cropResizeMakeBorder() [1/2]

void cv::cann::cropResizeMakeBorder ( const AscendMat src,
AscendMat dst,
const Rect rect,
Size  dsize,
double  fx,
double  fy,
int  interpolation,
int  top,
int  left,
const int  borderType,
Scalar  value = Scalar() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ cropResizeMakeBorder() [2/2]

void cv::cann::cropResizeMakeBorder ( const InputArray  src,
OutputArray  dst,
const Rect rect,
Size  dsize,
double  fx,
double  fy,
int  interpolation,
int  top,
int  left,
const int  borderType,
Scalar  value = Scalar() 
)

#include <opencv2/cann_interface.hpp>

crop a sub image from a big one, resize it to certain size, and form the top/left border and fills it with specified bordertype.

Parameters
srcinput array.
dstoutput array; it has the size Size(dsize.height + top, dsize.width + left).
recta rect to crop a array to
dsizeresize size;
fxscale factor along the horizontal axis;
fyscale factor along the vertical axis;
interpolationinterpolation method, only INTER_NEAREST and INTER_LINEAR are supported. (see cv.cann.InterpolationFlags)
borderTypeborder extrapolate method, only cv::BorderTypes::BORDER_CONSTANT and cv::BorderTypes::BORDER_REPLICATE are supported.
valueBorder BGR or YUV value if borderType==BORDER_CONSTANT.
topNumber of pixels for top padding
leftNumber of pixels for left padding
Note
The input images must be uint8, and only GRAY and BGR images are supported. The resolution of input and output images must in range of [10*6, 4096*4096].
Only the following devices are supported: Atlas Inference Series products, Atlas 200/500 A2 Inference products and Atlas A2 Training Series products/Atlas 300I A2 Inference products.
See also
cv::gapi::crop, cv::resize, cv::cann::resize, cv::BorderTypes

◆ flip() [1/2]

void cv::cann::flip ( const AscendMat src,
AscendMat dst,
int  flipCode,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ flip() [2/2]

void cv::cann::flip ( InputArray  src,
OutputArray  dst,
int  flipCode,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Flips a 2D matrix around vertical, horizontal, or both axes.

Parameters
srcSource matrix.
dstDestination matrix.
flipCodeFlip mode for the source:
  • 0 Flips around x-axis.
  • > 0 Flips around y-axis.
  • < 0 Flips around both axes.
streamAscendStream for the asynchronous version.
Note
src must be one of the following types: float16,float,int64,int32,int16,uint16
See also
cv::flip cv::cuda::flip

◆ merge() [1/4]

void cv::cann::merge ( const AscendMat src,
size_t  n,
AscendMat dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Makes a multi-channel matrix out of several single-channel matrices.

Parameters
srcArray/vector of source matrices.
nNumber of source matrices.
dstDestination matrix.
streamAscendStream for the asynchronous version.
Note
src must be one of the following types: float16, float32, double, int32, int16, int8, int64, uint8, uint16, uint32, uint64.
See also
cv::merge cv::cuda::merge

◆ merge() [2/4]

void cv::cann::merge ( const AscendMat src,
size_t  n,
OutputArray dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ merge() [3/4]

void cv::cann::merge ( const std::vector< AscendMat > &  src,
AscendMat dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ merge() [4/4]

void cv::cann::merge ( const std::vector< AscendMat > &  src,
OutputArray dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ resize() [1/2]

void cv::cann::resize ( const AscendMat src,
AscendMat dst,
Size  dsize,
double  fx,
double  fy,
int  interpolation,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ resize() [2/2]

void cv::cann::resize ( InputArray  src,
OutputArray  dst,
Size  dsize,
double  fx,
double  fy,
int  interpolation,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Resizes an image src down to or up to the specified size.

Parameters
srcinput image
dstoutput image; it has the size dsize (when it is non-zero) or the size computed from src.size(), fx, and fy; the type of dst is the same as of src.
dsizeoutput image size; if it equals zero, it is computed as:

\[𝚍𝚜𝚒𝚣𝚎 = 𝚂𝚒𝚣𝚎(𝚛𝚘𝚞𝚗𝚍(𝚏𝚡*𝚜𝚛𝚌.𝚌𝚘𝚕𝚜), 𝚛𝚘𝚞𝚗𝚍(𝚏𝚢*𝚜𝚛𝚌.𝚛𝚘𝚠𝚜))\]

Either dsize or both fx and fy must be non-zero.
fxscale factor along the horizontal axis; when it equals 0, it is computed as

\[(𝚍𝚘𝚞𝚋𝚕𝚎)𝚍𝚜𝚒𝚣𝚎.𝚠𝚒𝚍𝚝𝚑/𝚜𝚛𝚌.𝚌𝚘𝚕𝚜\]

fyscale factor along the vertical axis; when it equals 0, it is computed as

\[(𝚍𝚘𝚞𝚋𝚕𝚎)𝚍𝚜𝚒𝚣𝚎.𝚑𝚎𝚒𝚐𝚑𝚝/𝚜𝚛𝚌.𝚛𝚘𝚠𝚜\]

interpolationinterpolation method(see cv.cann.InterpolationFlags)
streamAscendStream for the asynchronous version.
Note
There are some constraints for the input datatype: when resampling using nearest neighbor or bilinear interpolation: Input images must be uint8, and only GRAY and BGR images are supported. The resolution of input and output images must in range of [10*6, 4096*4096]. bicubic interpolation: Input images can be of different types, output images must be float or uint8. pixel area interpolation: Input images can be of different types but output images are always float.
Only the following devices are supported when resampling using nearest neighbor or bilinear interpolation: Atlas Inference Series products, Atlas 200/500 A2 Inference products and Atlas A2 Training Series products/Atlas 300I A2 Inference products
See also
cv::resize

◆ rotate() [1/2]

void cv::cann::rotate ( const AscendMat src,
AscendMat dst,
int  rotateMode,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ rotate() [2/2]

void cv::cann::rotate ( InputArray  src,
OutputArray  dst,
int  rotateCode,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Rotates a 2D array in multiples of 90 degrees. The function cv::rotate rotates the array in one of three different ways: Rotate by 90 degrees clockwise (rotateCode = ROTATE_90_CLOCKWISE). Rotate by 180 degrees clockwise (rotateCode = ROTATE_180). Rotate by 270 degrees clockwise (rotateCode = ROTATE_90_COUNTERCLOCKWISE).

Parameters
srcinput array.
dstoutput array of the same type as src. The size is the same with ROTATE_180, and the rows and cols are switched for ROTATE_90_CLOCKWISE and ROTATE_90_COUNTERCLOCKWISE.
rotateCodean enum to specify how to rotate the array; see the enum RotateFlags
streamAscendStream for the asynchronous version.
Note
src must be one of the following types: float16,float,int64,int32,int16,uint16
See also
cv::rotate

◆ split() [1/4]

void cv::cann::split ( const AscendMat src,
AscendMat dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Copies each plane of a multi-channel matrix into an array.

Parameters
srcSource matrix.
dstDestination array/vector of single-channel matrices.
streamAscendStream for the asynchronous version.
Note
src must be one of the types:float16, float32, double, int64, int32, uint8, uint16, uint32, uint64, int8, int16, bool
See also
cv::split cv::cuda::split

◆ split() [2/4]

void cv::cann::split ( const AscendMat src,
std::vector< AscendMat > &  dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ split() [3/4]

void cv::cann::split ( const InputArray  src,
AscendMat dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ split() [4/4]

void cv::cann::split ( const InputArray  src,
std::vector< AscendMat > &  dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ transpose() [1/2]

void cv::cann::transpose ( const AscendMat src,
AscendMat dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ transpose() [2/2]

void cv::cann::transpose ( InputArray  src,
OutputArray  dst,
AscendStream stream = AscendStream::Null() 
)

#include <opencv2/cann_interface.hpp>

Transposes a matrix.

Parameters
srcSource matrix.
dstDestination matrix.
streamAscendStream for the asynchronous version.
Note
src must be one of the following types: float16,float,int8,int16,int32,int64,uint8,uint16,uint32,uint64,bool
See also
cv::transpose cv::cuda::transpose