Calculates eigen values and eigen vectors of image blocks for corner detection.
IppStatus ippiEigenValsVecs_8u32f_C1R(const Ipp8u* pSrc, int srcStep, Ipp32f* pEigenVV, int eigStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, Ipp8u* pBuffer);
IppStatus ippiEigenValsVecs_32f_C1R(const Ipp32f* pSrc, int srcStep, Ipp32f* pEigenVV, int eigStep, IppiSize roiSize, IppiKernelType kernType, int apertureSize, int avgWindow, Ipp8u* pBuffer);
ippKernelSobel |
Sobel kernel 3x3 or 5x5; |
ippKernelScharr |
Scharr kernel 3x3. |
The function ippiEigenValsVecs is declared in the ippcv.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function takes a block around the pixel and computes the first derivatives Dx and D y. This operation is performed for every pixel of the image using either Sobel or Scharr kernel in accordance with the kernType parameter. The size of the Sobel kernel may be specified by the parameter apertureSize. If this parameter is set to 3, the function used 3x3 kernel, if it is set to 5, the function uses 5x5 kernel. Only 3x3 size is available for the Scharr kernel, therefore the parameter apertureSize must be set to 3 if the Scharr kernel is used.
If the parameter apertureSize is set to 5 for operation with the Scharr kernel, the function returns error status.
Then, the function computes eigen values and vectors of the following
matrix:
The summation is performed over the full block with averaging over the blurring window with size avgWindow.
The image eigenVV has the following format. For every pixel of the source image it contains six floating-point values - λ1, λ2 , x1, y1, x2, y2. These values are defined as follows:
λ1, λ2 |
Eigen values of the above matrix (λ1 ≥ λ2 ≥ 0). |
x1, y1 |
Coordinates of the normalized eigen vector corresponding to λ1. |
x2, y2 |
Coordinates of the normalized eigen vector corresponding to λ2. |
In case of a singular matrix or when one eigen value is much smaller than the second one, all these six values are set to 0.
The function requires a temporary working buffer; its size should be computed previously by calling the function ippiEigenValsVecsGetBufferSize.
The parameters apertureSize and avgWindow must be the same for both functions ippiEigenValsVecsGetBufferSize and ippiEigenValsVecs.
Example “Using the function ippiEigenValsVecs” shows how to use the function ippiEigenValsVecs_8u32f_C1R.
ippStsNoErr |
Indicates no error. Any other value indicates an error or a warning. |
ippStsNullPtrErr |
Indicates an error condition if one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error condition if pRoiSize has a field with zero or negative value, or if apertureSize or avgWindow has an illegal value; or if kernType has wrong value. |
ippStsStepErr |
Indicates an error condition if srcStep is less than roiSize.width*<pixelSize>, or eigStep is less than roiSize.width*sizeof(Ipp32f)*6. |
ippStsNotEvenStepErr |
Indicates an error condition if steps for floating-point images are not divisible by 4. |
Ipp8u pSrc [4*3] = { 2, 17, 2, 21,
9, 4, 11, 5,
2, 32, 7, 2};
Ipp32f pEigenVV [24*3];
IppiSize roiSize = { 4, 3 };
int apertureSize = 3;
int avgWindow = 3;
int pBufferSize;
ippiEigenValsVecsGetBufferSize_8u32f_C1R ( roiSize, apertureSize, avgWindow, &pBufferSize );
Ipp8u* pBuffer = new Ipp8u [ pBufferSize ];
ippiEigenValsVecs_8u32f_C1R ( pSrc, 4, pEigenVV, 24*sizeof(Ipp32f), roiSize, ippKernelSobel, apertureSize, avgWindow, pBuffer );
result:
2 17 2 21
9 4 11 5 pSrc
2 32 7 2
pEigenVV
[0.3, 0.0, 0.9, 0.3, 0.3, -0.9] [0.2, 0.0, 1.0, 0.3, 0.3, -1.0] [0.3, 0.1, -0.7, 0.8, -0.8, -0.7] [0.5, 0.1, -0.7, 0.7, -0.7, -0.7]
[0.6, 0.1, 1.0, 0.2, 0.2, -1.0] [0.5, 0.1, 1.0, 0.0, 0.0, -1.0] [0.4, 0.2, -0.9, 0.4, -0.4, -0.9] [0.5, 0.2, -0.9, 0.5, -0.5, -0.9]
[0.9, 0.1, 1.0, 0.2, 0.2, -1.0] [0.9, 0.2, 1.0, 0.0, 0.0, -1.0] [0.5, 0.2, -1.0, 0.1, -0.1, -1.0] [0.5, 0.2, -1.0, 0.2, -0.2, -1.0]
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.