http://www.emgu.com
Raises every element of input array to p:
dst(I)=src(I)p, if p is integer
dst(I)=abs(src(I))p, otherwise
That is, for non-integer power exponent the absolute values of input array elements are used. However, it is possible to get true values for negative values using some extra operations, as the following sample, computing cube root of array elements, shows:
CvSize size = cvGetSize(src);
CvMat* mask = cvCreateMat( size.height, size.width, CV_8UC1 );
cvCmpS( src, 0, mask, CV_CMP_LT ); /* find negative elements */
cvPow( src, dst, 1./3 );
cvSubRS( dst, cvScalarAll(0), dst, mask ); /* negate the results of negative inputs */
cvReleaseMat( &mask );
For some values of power, such as integer values, 0.5 and -0.5, specialized faster algorithms are used.
Namespace: Emgu.CVAssembly: Emgu.CV (in Emgu.CV.dll) Version: 3.0.0.2161 (3.0.0.2161)
Syntaxpublic static void Pow(
IInputArray src,
double power,
IOutputArray dst
)
Public Shared Sub Pow (
src As IInputArray,
power As Double,
dst As IOutputArray
)
public:
static void Pow(
IInputArray^ src,
double power,
IOutputArray^ dst
)
static member Pow :
src : IInputArray *
power : float *
dst : IOutputArray -> unit
Parameters
- src
- Type: Emgu.CVIInputArray
The source array - power
- Type: SystemDouble
The exponent of power - dst
- Type: Emgu.CVIOutputArray
The destination array, should be the same type as the source
See Also