Developer Reference for Intel® Integrated Performance Primitives 2019

FastN

Detects corners in an image using the FastN algorithm.

Syntax

IppStatus ippiFastN_8u_C1R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDstCorner, int dstCornerStep, Ipp8u* pDstScore, int dstScoreStep, int* pNumCorner, IppiPoint srcRoiOffset, IppiSize dstRoiSize, IppiFastNSpec* pSpec, Ipp8u* pBuffer);

Include Files

ippcv.h

Domain Dependencies

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

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

Parameters

pSrc

Pointer to the source image.

srcStep

Distance, in bytes, between the starting points of consecutive lines in the source image.

pDstCorner

Pointer to the destination image with corners.

dstCornerStep

Distance, in bytes, between the starting points of consecutive lines in the destination image with corners.

pDstScore

Pointer to the destination image with scores.

dstScoreStep

Distance, in bytes, between the starting points of consecutive lines in the destination image with scores.

pNumCorner

Pointer to the calculated number of corners.

srcRoiOffset

Offset in the source image.

dstRoiSize

Size of the destination ROI, in pixels.

pSpec

Pointer to the specification structure.

pBuffer

Pointer to the work buffer.

Description

The ippiFastN function implements the FastN corner detection algorithm. This function detects corners in the source image, calculates orientation and score of corners.

The figures below show pixels location for different radius values.

Radius = 1

Radius = 2



Radius = 3

Radius = 5



Radius = 7



Radius = 9



The function defines a pixel as a corner if the value of N consecutive pixels located on the circle with the center at the current pixel is greater (less) than the value of the current - central pixel. Differences between the values of pixels on the circle and the central pixel value must be greater than the threshold value. In this case, the corresponding pixel of the pDstCorner image is set to the following values in binary format:

If the IPP_FASTN_ORIENTATION mode is not set, xxxxxx = 000000, otherwise, xxxxxx = the number of sector (bin) to which the corner directs. The orientationBin parameter defines the number of sectors that is computed from the bottom clockwise. If the source pixel is not a corner, the corresponding pixel of pDstCorner is set to zero.

If the IPP_FASTN_SCORE_MODE0 mode is set, the corresponding pixel of pDstCorner is set to the corner score. Score is a maximum among minimal differences with threshold calculated for every N consecutive pixels. If the source pixel is not a corner, the corresponding pixel of pDstScore is set to zero.

If the IPP_FASTN_NMS mode is set, the corners that have a corner with the greater score among neighboring pixels are cancelled.

Return Values

ippStsNoErr
Indicates no error. Any other value indicates an error.
ippStsNullPtrErr
Indicates an error when:
  • pSrc, pDstCorner, pNumCorner, pSpec, or pBuffer is NULL

  • pDstScore is NULL if option is not equal to IPP_FASTN_SCORE_MODE0

ippStsSizeErr
Indicates an error when dstRoiSize is less than, or equal to zero.
ippDataTypeErr
Indicates an error when dataType has an illegal value.
ippNumChannelsErr
Indicates an error when numChannels has an illegal value.
ippOutOfRangeErr
Indicates an error when orientationBins or N has an illegal value.
ippBadArgsErr
Indicates an error when option or circleRadius has an illegal value.
ippThresholdErr
Indicates an error when threshold is negative.

Example

FastN.c

See Also