IMG_perimeter_16


Detailed Description


Functions

int IMG_perimeter_16 (const unsigned short *restrict in, int cols, unsigned short *restrict out)


Function Documentation

int IMG_perimeter_16 ( const unsigned short *restrict  in,
int  cols,
unsigned short *restrict  out 
)

Description:
This function returns the boundary pixels of an image. Each call of this function calculates one new line of output from a three line window of input.
The input pointer "in" points to the middle line of a three-line window of the image. The perimeter function scans this window looking for pixels in the middle row which are on the perimeter of the image. A pixel is considered to be on the perimeter of the image if the pixel itself is non-zero, but one of its neighbors is zero. The function returns the total count of perimeter pixels identified.
This particular implementation evaluates four neighbors for the perimeter test: The neighbors to the left, right, top and bottom.
Perimeter pixels retain their original grey level in the output. Non-perimeter pixels are set to zero in the output. Pixels on the far left and right edges of a row are defined *not* being on the perimeter and, as such, are always forced to zero.
Parameters:
in Pointer to middle row of three-row input image data
cols Width of the input image data
out Output data pointer
Algorithm:
The natural C implementation has no restrictions. The optimized intrinsic C code has restrictions as noted in Assumptions below.
Assumptions:
  • The input and output arrays should not overlap
  • The input and output images must be 64-bit aligned.
  • The cols parameter must be a non-zero multiple of 8
Implementation Notes:
  • This code is fully interruptible
  • This code is compatible with C66x processors
Benchmarks:
See IMGLIB_Test_Report.html for cycle and memory information.


Copyright 2012, Texas Instruments Incorporated