Qualcomm FastCV Library  1.7.1
Shape and drawing

Functions

FASTCV_API void fcvFillConvexPolyu8 (uint32_t nPts, const uint32_t *__restrict polygon, uint32_t nChannel, const uint8_t *__restrict color, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride)
 Draw convex polygon.
FASTCV_API void fcvPointPolygonTest (uint32_t nPts, const uint32_t *__restrict polygonContour, uint32_t px, uint32_t py, float32_t *distance, int16_t *resultFlag)
 Determines whether a given point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It returns positive, negative or zero value, correspondingly. Also measures distance between the point and the nearest contour edge if distance is requested.
FASTCV_API void fcvFindConvexHull (uint32_t *__restrict polygonContour, uint32_t nPtsContour, uint32_t *__restrict convexHull, uint32_t *nPtsHull, uint32_t *__restrict tmpBuff)
 Find the convex hull of the input polygon.
FASTCV_API void fcvDrawContouru8 (uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t nContours, const uint32_t *__restrict holeFlag, const uint32_t *__restrict numContourPoints, const uint32_t **__restrict contourStartPoints, uint32_t pointBufferSize, const uint32_t *__restrict pointBuffer, int32_t hierarchy[][4], uint32_t max_level, int32_t thickness, uint8_t color, uint8_t hole_color)
 Draw the contour or fill the area enclosed by the contour. The algorithm using even-odd rule to fill the contour. Currently Antialiazing is not supported.
FASTCV_API void fcvDrawContourInterleavedu8 (uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t nContours, const uint32_t *__restrict holeFlag, const uint32_t *__restrict numContourPoints, const uint32_t **__restrict contourStartPoints, uint32_t pointBufferSize, const uint32_t *__restrict pointBuffer, int32_t hierarchy[][4], uint32_t max_level, int32_t thickness, uint8_t colorR, uint8_t colorG, uint8_t colorB, uint8_t hole_colorR, uint8_t hole_colorG, uint8_t hole_colorB)
 Draw the contour or fill the area enclosed by the contour. Currently Antialiazing is not supported.
FASTCV_API void fcvDrawContourPlanaru8 (uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint32_t nContours, const uint32_t *__restrict holeFlag, const uint32_t *__restrict numContourPoints, const uint32_t **__restrict contourStartPoints, uint32_t pointBufferSize, const uint32_t *__restrict pointBuffer, int32_t hierarchy[][4], uint32_t max_level, int32_t thickness, uint8_t colorR, uint8_t colorG, uint8_t colorB, uint8_t hole_colorR, uint8_t hole_colorG, uint8_t hole_colorB)
 Draw the contour or fill the area enclosed by the contour. Currently Antialiazing is not supported.

Detailed Description

Contour and polygon drawing functions


Function Documentation

FASTCV_API void fcvDrawContourInterleavedu8 ( uint8_t *__restrict  src,
uint32_t  srcWidth,
uint32_t  srcHeight,
uint32_t  srcStride,
uint32_t  nContours,
const uint32_t *__restrict  holeFlag,
const uint32_t *__restrict  numContourPoints,
const uint32_t **__restrict  contourStartPoints,
uint32_t  pointBufferSize,
const uint32_t *__restrict  pointBuffer,
int32_t  hierarchy[][4],
uint32_t  max_level,
int32_t  thickness,
uint8_t  colorR,
uint8_t  colorG,
uint8_t  colorB,
uint8_t  hole_colorR,
uint8_t  hole_colorG,
uint8_t  hole_colorB 
)

Draw the contour or fill the area enclosed by the contour. Currently Antialiazing is not supported.

Parameters:
srcInput image/patch. It's 3 channel RGB color image in interleaved format. Size of buffer is srcStride*srcHeight bytes.
WARNING: should be 128-bit aligned.
srcWidthImage width, the number of pixels in a row
NOTE: should be a multiple of 8.
srcHeightImage height
srcStrideStride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth*3.
NOTE: should be a multiple of 8.
nContoursThe total number of contours to be drawn.
holeFlagThe flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole.
numContourPointsThe array that stores the length of each contour;
contourStartPointsThe array that stores the pointer of the starting point of each contour
pointBufferSizeThe size of the point buffer, in the number of bytes.
pointBufferThe array that stores all the x,y coordinates of all the contours.
WARNING: should be 128-bit aligned.
hierarchyThe array that stores the left,right,ancestor and decendant of each contour.
max_levelThe max level we at which we draw the contour, it stops drawing after we reach this level.
thicknessIndicate the thickness of the contour to be drawn, if it's 0, do a fill.
colorR,colorG,colorBThe color value used to draw/fill the contour, currently support value from 0-255;
hole_colorR,hole_colorG,hole_colorBThe color value used to fill the hole, currently support value from 0-255;
FASTCV_API void fcvDrawContourPlanaru8 ( uint8_t *__restrict  src,
uint32_t  srcWidth,
uint32_t  srcHeight,
uint32_t  srcStride,
uint32_t  nContours,
const uint32_t *__restrict  holeFlag,
const uint32_t *__restrict  numContourPoints,
const uint32_t **__restrict  contourStartPoints,
uint32_t  pointBufferSize,
const uint32_t *__restrict  pointBuffer,
int32_t  hierarchy[][4],
uint32_t  max_level,
int32_t  thickness,
uint8_t  colorR,
uint8_t  colorG,
uint8_t  colorB,
uint8_t  hole_colorR,
uint8_t  hole_colorG,
uint8_t  hole_colorB 
)

Draw the contour or fill the area enclosed by the contour. Currently Antialiazing is not supported.

Parameters:
srcInput image/patch. It's 3 channel RGB color image in planar format. Size of buffer is srcStride*srcHeight*3 bytes.
WARNING: should be 128-bit aligned.
srcWidthImage width, the number of pixels in a row
NOTE: should be a multiple of 8.
srcHeightImage height
srcStrideStride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory of any color plane. If left at 0 srcStride is default to srcWidth.
NOTE: should be a multiple of 8.
nContoursThe total number of contours to be drawn.
holeFlagThe flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole.
numContourPointsThe array that stores the length of each contour;
contourStartPointsThe array that stores the pointer of the starting point of each contour
pointBufferSizeThe size of the point buffer, in the number of bytes.
pointBufferThe array that stores all the x,y coordinates of all the contours.
WARNING: should be 128-bit aligned.
hierarchyThe array that stores the left,right,ancestor and decendant of each contour.
max_levelThe max level we at which we draw the contour, it stops drawing after we reach this level.
thicknessIndicate the thickness of the contour to be drawn, if it's 0, do a fill.
colorR,colorG,colorBThe color value used to draw/fill the contour, currently support value from 0-255;
hole_colorR,hole_colorG,hole_colorBThe color value used to fill the hole, currently support value from 0-255;
FASTCV_API void fcvDrawContouru8 ( uint8_t *__restrict  src,
uint32_t  srcWidth,
uint32_t  srcHeight,
uint32_t  srcStride,
uint32_t  nContours,
const uint32_t *__restrict  holeFlag,
const uint32_t *__restrict  numContourPoints,
const uint32_t **__restrict  contourStartPoints,
uint32_t  pointBufferSize,
const uint32_t *__restrict  pointBuffer,
int32_t  hierarchy[][4],
uint32_t  max_level,
int32_t  thickness,
uint8_t  color,
uint8_t  hole_color 
)

Draw the contour or fill the area enclosed by the contour. The algorithm using even-odd rule to fill the contour. Currently Antialiazing is not supported.

Parameters:
src8-bit image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes.
NOTE: should be 128-bit aligned.
srcWidthImage width, the number of pixels in a row
NOTE: should be a multiple of 8.
srcHeightImage height
srcStrideStride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth.
NOTE: should be a multiple of 8.
nContoursThe total number of contours to be drawn.
holeFlagThe flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole.
numContourPointsThe array that stores the length of each contour;
contourStartPointsThe array that stores the pointer of the starting point of each contour
pointBufferSizeThe size of the point buffer, in the number of bytes.
pointBufferThe array that stores all the x,y coordinates of all the contours.
WARNING: should be 128-bit aligned.
hierarchyThe array that stores the left,right,ancestor and decendant of each contour.
max_levelThe max level we at which we draw the contour, it stops drawing after we reach this level.
thicknessIndicate the thickness of the contour to be drawn, if it's 0, do a fill.
colorThe color value used to draw/fill the contour, currently support grayscale value from 0-255;
hole_colorThe color value used to fill the hole;
FASTCV_API void fcvFillConvexPolyu8 ( uint32_t  nPts,
const uint32_t *__restrict  polygon,
uint32_t  nChannel,
const uint8_t *__restrict  color,
uint8_t *__restrict  dst,
uint32_t  dstWidth,
uint32_t  dstHeight,
uint32_t  dstStride 
)

Draw convex polygon.

This function fills the interior of a convex polygon with the specified color.

Parameters:
polygonCoordinates of polygon vertices (x0,y0,x1,y1,...), size of buffer is 2*nPts
WARNING: should be 128-bit aligned.
nPtsNumber of polygon vertices
colorColor of drawn polygon stored as B,G,R and A(if supported)
nChannelNumber of color channels (typical value is 1 or 3)
dstDestination image, size of image buffer is (dstStride * dstHeight) bytes
WARNING: should be 128-bit aligned.
dstWidthImage width, the number of pixels in a row.
NOTE: should be a multiple of 8.
dstHeightImage height.
dstStrideStride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to (dstWidth * nChannel).
NOTE: should be a multiple of 8.
FASTCV_API void fcvFindConvexHull ( uint32_t *__restrict  polygonContour,
uint32_t  nPtsContour,
uint32_t *__restrict  convexHull,
uint32_t *  nPtsHull,
uint32_t *__restrict  tmpBuff 
)

Find the convex hull of the input polygon.

Determines the convex hull of a simple polygon using the Melkman algorithm. The input to the function is the interleaved coordinates of the polygon and the output is the set of interleaved coordinates of the convex hull of the polygon. The algorithm assumes that the coordinates of the polygon are provided in the manner of an ordered traversal.

Parameters:
polygonContourInput contour containing the points of the polygon for which the convex hull is to be found. Coordinates are stored in the interleaved form as x y x y. NOTE: The polygon must be a simple polygon, i.e., it has no self intersections. Also coordinates are assumed to be stored in the manner of an ordered traversal.
WARNING: should be 128-bit aligned. Size of buffer is
nPtsContour
nPtsContourTotal number of points in the contour. For example if there are 10 point sets, i.e. (x,y) in the contour, then nPtsContour equals 20.
convexHullThe output buffer containing the interleaved coordinates of the convex hull.
WARNING: should be 128-bit aligned. Size of buffer is
nPtsHull
nPtsHullTotal number of points in the convex hull. For example if there are 10 point sets, i.e. (x,y) in the contour, then nPtsHull equals 20.
tmpBuffScratch buffer used in the computation of the convex hull.
NOTE: MUST be allocated twice as large in size as the input polygonContour.
WARNING: should be 128-bit aligned.
FASTCV_API void fcvPointPolygonTest ( uint32_t  nPts,
const uint32_t *__restrict  polygonContour,
uint32_t  px,
uint32_t  py,
float32_t *  distance,
int16_t *  resultFlag 
)

Determines whether a given point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It returns positive, negative or zero value, correspondingly. Also measures distance between the point and the nearest contour edge if distance is requested.

Parameters:
nPtsTotal number of points in the contour. For example if there are 10 point sets, i.e. (x,y) in the contour, then nPts equals 20.
polygonContourInput contour containing the points of the polygon. Coordinates are stored in the interleaved form as x y x y. Size of buffer is
nPts
WARNING: should be 128-bit aligned.
pxThe x-coordinate of the input point to be tested.
pyThe y-coordinate of the input point to be tested.
distanceIt contains the signed distance of the point to the closest edge of the contour If passed as a NULL pointer, then no distance is computed.
resultFlagAssumes the value of -1, 0 or 1 based on whether the point is outside, coincides with a vertex, or lies inside the contour respectively.
 All Data Structures Files Functions Variables Enumerations Enumerator Defines