Qualcomm FastCV Library
1.7.1
|
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. |
Contour and polygon drawing functions
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.
src | Input 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. |
srcWidth | Image width, the number of pixels in a row NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride 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. |
nContours | The total number of contours to be drawn. |
holeFlag | The flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole. |
numContourPoints | The array that stores the length of each contour; |
contourStartPoints | The array that stores the pointer of the starting point of each contour |
pointBufferSize | The size of the point buffer, in the number of bytes. |
pointBuffer | The array that stores all the x,y coordinates of all the contours. WARNING: should be 128-bit aligned. |
hierarchy | The array that stores the left,right,ancestor and decendant of each contour. |
max_level | The max level we at which we draw the contour, it stops drawing after we reach this level. |
thickness | Indicate the thickness of the contour to be drawn, if it's 0, do a fill. |
colorR,colorG,colorB | The color value used to draw/fill the contour, currently support value from 0-255; |
hole_colorR,hole_colorG,hole_colorB | The 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.
src | Input 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. |
srcWidth | Image width, the number of pixels in a row NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride 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. |
nContours | The total number of contours to be drawn. |
holeFlag | The flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole. |
numContourPoints | The array that stores the length of each contour; |
contourStartPoints | The array that stores the pointer of the starting point of each contour |
pointBufferSize | The size of the point buffer, in the number of bytes. |
pointBuffer | The array that stores all the x,y coordinates of all the contours. WARNING: should be 128-bit aligned. |
hierarchy | The array that stores the left,right,ancestor and decendant of each contour. |
max_level | The max level we at which we draw the contour, it stops drawing after we reach this level. |
thickness | Indicate the thickness of the contour to be drawn, if it's 0, do a fill. |
colorR,colorG,colorB | The color value used to draw/fill the contour, currently support value from 0-255; |
hole_colorR,hole_colorG,hole_colorB | The 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.
src | 8-bit image where keypoints are detected. Size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | Image width, the number of pixels in a row NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride 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. |
nContours | The total number of contours to be drawn. |
holeFlag | The flag arrays indicate if the corresponding contour is a hole. 1 indicates a hole and 0 indicates it's not a hole. |
numContourPoints | The array that stores the length of each contour; |
contourStartPoints | The array that stores the pointer of the starting point of each contour |
pointBufferSize | The size of the point buffer, in the number of bytes. |
pointBuffer | The array that stores all the x,y coordinates of all the contours. WARNING: should be 128-bit aligned. |
hierarchy | The array that stores the left,right,ancestor and decendant of each contour. |
max_level | The max level we at which we draw the contour, it stops drawing after we reach this level. |
thickness | Indicate the thickness of the contour to be drawn, if it's 0, do a fill. |
color | The color value used to draw/fill the contour, currently support grayscale value from 0-255; |
hole_color | The 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.
polygon | Coordinates of polygon vertices (x0,y0,x1,y1,...), size of buffer is 2*nPts WARNING: should be 128-bit aligned. |
nPts | Number of polygon vertices |
color | Color of drawn polygon stored as B,G,R and A(if supported) |
nChannel | Number of color channels (typical value is 1 or 3) |
dst | Destination image, size of image buffer is (dstStride * dstHeight) bytes WARNING: should be 128-bit aligned. |
dstWidth | Image width, the number of pixels in a row. NOTE: should be a multiple of 8. |
dstHeight | Image height. |
dstStride | Stride 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.
polygonContour | Input 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 | |
nPtsContour | Total 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. |
convexHull | The output buffer containing the interleaved coordinates of the convex hull. WARNING: should be 128-bit aligned. Size of buffer is |
nPtsHull | |
nPtsHull | Total 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. |
tmpBuff | Scratch 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.
nPts | Total 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. |
polygonContour | Input 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. |
px | The x-coordinate of the input point to be tested. |
py | The y-coordinate of the input point to be tested. |
distance | It 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. |
resultFlag | Assumes the value of -1, 0 or 1 based on whether the point is outside, coincides with a vertex, or lies inside the contour respectively. |