Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

FilterSobelNegVertBorder

Applies vertical Sobel filter with border.

Syntax

IppStatus ippiFilterSobelNegVertBorder_<mod>(const Ipp<srcDatatype>* pSrc, int srcStep, Ipp<dstDatatype>* pDst, int dstStep, IppiSize dstRoiSize, IppiMaskSize mask, IppiBorderType borderType, Ipp<srcDatatype> borderValue, Ipp8u* pBuffer);

Supported values for mod:

8u16s_C1R 32f_C1R

Include Files

ippi.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Parameters

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 destination image ROI.

mask

Type of the filter kernel.

borderType

Type of border (see Borders in Neighborhood Operations ); following values are possible:

ippBorderConst

Values of all border pixels are set to constant.

ippBorderRepl

Replicated border is used.

ippBorderMirror

Mirrored border is used

ippBorderMirrorR

Mirrored border with replication is used

borderValue

The constant value to assign to the pixels in the constant border (not applicable for other border's type).

pBuffer

Pointer to the working buffer.

Description

These functions operate with ROI (see Regions of Interest in Intel IPP). These functions apply the vertical Sobel filter (x-derivative) to the source image ROI pSrc and stores results to the destination image ROI of the same size pDst. Source image can be used as the destination image if they have the same data type. The values of border pixels are assigned in accordance with the borderType and borderValue parameters. The kernel of this filter is the matrix of either 3x3 or 5x5 size that is specified by the parameter mask. The anchor cell is the center cell of the kernel (red).

The function ippiFilterSobelVertBorde uses the kernels with the following coefficients:

                             -1   -2   0   2   1
  -1   0   1                 -4   -8   0   8   4
  -2   0   2       or        -6  -12   0  12   6
  -1   0   1                 -4   -8   0   8   4
                             -1   -2   0   2   1

The function ippiFilterSobelNegVertBoreder uses the kernels which coefficients are the same in magnitude but opposite in sign:

                              1   2   0  -2  -1
   1   0  -1                  4   8   0  -8  -4
   2   0  -2       or         6  12   0 -12  -6
   1   0  -1                  4   8   0  -8  -4
                              1   2   0  -2  -1

Before using this function, compute the size of the work buffer pBuffer using the FilterSobelNegVertBorderGetBufferSize function.

Example shows how the function ippiFilterSobelNegVertBorder_8u16s_C1R can be used for edge detection.

Return Values

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 roiSize has a field with a zero or negative value.

ippStsStepErr

Indicates an error condition if srcStep or dstStep is less than roiSize.width * <pixelSize>

ippStsNotEvenStepErr

Indicates an error condition if one of the step values is not divisible by 4 for floating-point images, or by 2 for short-integer images.

ippStsBadArgErr

Indicates an error if borderType or divisor has a wrong value.

ippStsMaskErr

Indicates an error condition if mask has a wrong value.