Visible to Intel only — GUID: GUID-760865BD-59C8-466E-BBD8-1444E7255649
Visible to Intel only — GUID: GUID-760865BD-59C8-466E-BBD8-1444E7255649
FastMarching
Calculates distance transform to closest zero pixel for all non-zero pixels of source image using fast marching method.
Syntax
IppStatus ippiFastMarching_8u32f_C1R(const Ipp8u* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize, Ipp32f radius, 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 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.
- roiSize
- Size of the source and destination image ROI.
- radius
- Radius of the neighborhood of the marked area.
- pBuffer
- Pointer to the working buffer.
Description
This function operates with ROI (see Regions of Interest in Intel IPP ).
This function computes the distance from the closest zero pixel to each image pixel according to the Fast Marching Method (FMM) [ Telea04 ]. The FMM distance for area Ω with the border ∂Ω is a solution of the equations:
The resulting distance complies with the equation
Here {u1, v1} and {u2, v2} are coordinates for pair of pixels adjacent to the pixel with {x, y} coordinates.
The area Ω is defined by the non-zero pixel of the image pSrc. If raduis is positive, then the FMM distance with the negative sign is calculated in Euclidean raduis-neighborhood of Ω.
The function requires the working buffer pBuffer whose size should be computed by the function FastMarchingGetBufferSize beforehand.
Figure “Result of the FFM Method shows the result of the fast marching method for the 7x9 image with centered 3x5 non-zero mask and raduis=1.
0.0000 0.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 0.0000 0.0000 0.0000 0.7071 -1.e-10 -1.e-10 -1.e-10 -1.e-10 -1.e-10 0.7071 -1.0000 -1.0000 -1.e-10 0.7071 0.9659 0.9994 0.9659 0.7071 -1.e-10 -1.0000 -1.0000 -1.e-10 0.9659 1.6730 1.9579 1.6730 0.9659 -1.e-10 -1.0000 -1.0000 -1.e-10 0.7071 0.9659 0.9994 0.9659 0.7071 -1.e-10 -1.0000 0.0000 0.7071 -1.e-10 -1.e-10 -1.e-10 -1.e-10 -1.e-10 0.7071 -1.0000 0.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 0.0000
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 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 the step value is not divisible by 4 for floating-point images. |
ippStsBadArgErr |
Indicates an error condition if raduis is negative. |