Filters an image using a spatial kernel that consists of a single column.
Case 1: Operation on integer data
IppStatus ippiFilterColumn_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp32s* pKernel, int kernelSize, int yAnchor, int divisor);
Supported values for mod:
8u_C1R | 16u_C1R | 16s_C1R |
8u_C3R | 16u_C3R | 16s_C3R |
8u_C4R | 16u_C4R | 16s_C4R |
8u_AC4R | 16u_AC4R | 16s_AC4R |
Case 2: Operation on floating-point data
IppStatus ippiFilterColumn_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp32f* pKernel, int kernelSize, int yAnchor);
Supported values for mod:
32f_C1R | 64f_C1R |
32f_C3R | |
32f_C4R | |
32f_AC4R |
pSrc |
Pointer to the source image ROI. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
pDst |
Pointer to the destination image ROI. |
dstStep |
Distance in bytes between starts of consecutive lines in the destination image. |
dstRoiSize |
Size of the source and destination ROI in pixels. |
pKernel |
Pointer to the kernel values. |
kernelSize |
Size of the kernel in pixels. |
yAnchor |
Anchor cell specifying the kernel vertical alignment with respect to the position of the input pixel. |
divisor |
The integer value by which the computed result is divided (for operations on integer data only). |
The function ippiFilterColumn is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function uses the vertical column kernel of size kernelSize to filter an image ROI. This function sums the products between the kernel coefficients pKernel and pixel values taken over the source pixel neighborhood defined by kernelSize and yAnchor. Note that kernel coefficients are used in inverse order. The sum is written to the destination pixel. In case of integer data, the result is divided by the fixed scaling factor divisor. To ensure valid operation when image boundary pixels are processed, the application must correctly define additional border pixels (see Borders).
For function flavors that operate on integer data, the result value Yi,j for pixel Xi,j inside image's ROI is computed according to the following formula:
where:
Km are the kernel values;
H = kernelSize is the size of the vertical column kernel;
P = H - yAnchor - 1.
Function flavors that accept input data of the Ipp32f type use the same summation formula, but no scaling of the result is done.
Example “Using the Function ippiFilterColumn” show how to use the function ippiFilterColumn_8u_C1R.
ippStsNoErr |
Indicates no error. Any other value indicates an error. |
ippStsNullPtrErr |
Indicates an error condition if one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error condition if dstRoiSize has a field with a zero or negative value. |
ippStsDivisorErr |
Indicates an error condition if the divisor value is zero. |
Ipp8u src[4*5] = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 }; Ipp8u dst[4*3]; IppiSize srcRoi = { 4, 3 }; Ipp32s kern[] = { 1, -2, 1 }; // using "Sobel" kernel int kernelSize = 3; int yAnchor = 2; int divisor = 2; ippiFilterColumn_8u_C1R ( src, 4, dst, 4, srcRoi, kern, kernelSize, yAnchor, divisor);
Result:
1 2 3 4 1 2 3 4 src 1 2 3 4 1 -2 1 kern 0 0 0 0 0 0 0 0 dst 0 0 0 0
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.