FilterSobelVertSecond

Filters an image using a second derivative vertical Sobel operator.

Syntax

IppStatus ippiFilterSobelVertSecond_<mod>(const Ipp<srcDatatype>* pSrc, int srcStep, Ipp<dstDatatype>* pDst, int dstStep, IppiSize dstRoiSize, IppiMaskSize mask);

Supported values for mod:

8u16s_C1R 8s16s_C1R 32f_C1R

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 source and destination ROI in pixels.

mask

Predefined mask of IppiMaskSize type.

Description

The function ippiFilterSobelVertSecond is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function applies a second derivative vertical Sobel operator to an image ROI. The corresponding kernel is the matrix of either 3x3 or 5x5 size with the following values:

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

The anchor cell is the center cell of the kernel (red). The size of the source image ROI is equal to dstRoiSize, the size of the destination image ROI.

This filter has the effect of both enhancing and smoothing vertical edges of an image.

To ensure valid operation when image boundary pixels are processed, the application should correctly define additional border pixels (see Borders).

Example “Using the Function ippiFilterSobelVertSecond” shows how to use the function ippiFilterSobelVertSecond_8u16s_C1R.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if pSrc or pDst is NULL.

ippStsSizeErr

Indicates an error condition if dstRoiSize has a field with a zero or negative value.

ippStsStepErr

Indicates an error condition if srcStep or dstStep has a zero or negative value.

ippStsMaskSizeErr

Indicates an error condition if mask has an illegal value.

Using the Function ippiFilterSobelVertSecond

Ipp8u pSrc[8*8]={
                  4, 4, 4, 4, 4, 4, 4, 4,
                  4, 3, 3, 3, 3, 3, 3, 4,
                  4, 3, 2, 2, 2, 2, 3, 4,
                  4, 3, 2, 1, 1, 2, 3, 4,
                  4, 3, 2, 1, 1, 2, 3, 4,
                  4, 3, 2, 2, 2, 2, 3, 4,
                  4, 3, 3, 3, 3, 3, 3, 4,
                  4, 4, 4, 4, 4, 4, 4, 4
                 };
Ipp16s pDst[8*8];
IppiSize Roi = { 8, 8 };

ippiFilterSobelVertSecond_8u16s_C1R ( pSrc, 8, pDst, 8*sizeof( Ipp16s ),
 Roi,  ippMskSize3x3 );

Result:

4 4 4 4 4 4 4 4
4 3 3 3 3 3 3 4
4 3 2 2 2 2 3 4
4 3 2 1 1 2 3 4
4 3 2 1 1 2 3 4      pSrc
4 3 2 2 2 2 3 4
4 3 3 3 3 3 3 4
4 4 4 4 4 4 4 4


 399 1 0   0  0    0   1 -201
 197 2 1   0  0    1   2   -3
  -4 1 2   1  1    2   1   -4
  -4 0 1   3  3    1   0   -4        pDst
  -4 0 1   3  3    1   0   -4
  -4 1 2   1  1    2   1   -4
  -3 2 1   0  0    1   2  197
-201 1 0 -12 75 -300 220  593

for example, on real picture it can looks like this

                    size 128x128          size  126x126
                    roi  126x126           roi  126x126
                                          ippMskSize3x3




Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.