Qualcomm FastCV Library
1.7.1
|
Functions | |
FASTCV_API int | fcvScaleDownBy2u8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst) |
Down-scale the image to half width and height by averaging 2x2 pixels into one. | |
FASTCV_API int | fcvScaleDownBy2u8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstStride) |
Down-scale the image to half width and height by averaging 2x2 pixels into one. | |
FASTCV_API void | fcvScaleDownBy2Gaussian5x5u8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst) |
Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel. | |
FASTCV_API void | fcvScaleDownBy2Gaussian5x5u8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstStride) |
Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel. | |
FASTCV_API int | fcvScaleDownBy4u8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst) |
Downscale the image to quarter width and height by averaging 4x4 pixels into one.. | |
FASTCV_API int | fcvScaleDownBy4u8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstStride) |
Downscale the image to quarter width and height by averaging 4x4 pixels into one.. | |
FASTCV_API int | fcvScaleDown3To2u8 (const uint8_t *__restrict src, unsigned srcWidth, unsigned srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstStride) |
Downscale the image to 2/3 width and height by averaging 3x3 pixels into one.. | |
FASTCV_API int | fcvScaleDownNNu8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride) |
Downsample Horizontaly and/or Vertically by an *integer* scale. | |
FASTCV_API void | fcvScaleDownu8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight) |
Downsample Horizontaly and/or Vertically by an *integer* scale. | |
FASTCV_API void | fcvScaleDownu8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride) |
Downsample Horizontaly and/or Vertically by an *integer* scale. | |
FASTCV_API void | fcvScaleUpBy2Gaussian5x5u8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst) |
Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel. | |
FASTCV_API void | fcvScaleUpBy2Gaussian5x5u8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstStride) |
Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel. | |
FASTCV_API int | fcvTransformAffine8x8u8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, const int32_t *__restrict nPos, const int32_t *__restrict nAffine, uint8_t *__restrict nPatch) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine. | |
FASTCV_API int | fcvTransformAffine8x8u8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const int32_t *__restrict nPos, const int32_t *__restrict nAffine, uint8_t *__restrict patch, unsigned int patchStride) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine. | |
FASTCV_API void | fcvWarpPerspectiveu8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, float *__restrict projectionMatrix) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable. | |
FASTCV_API void | fcvWarpPerspectiveu8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float *__restrict projectionMatrix) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable. | |
FASTCV_API void | fcv3ChannelWarpPerspectiveu8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, float *__restrict projectionMatrix) |
Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation. | |
FASTCV_API void | fcv3ChannelWarpPerspectiveu8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8_t *__restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float *__restrict projectionMatrix) |
Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation. | |
FASTCV_API int | fcvTransformAffineu8 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, const float *__restrict position, const float *__restrict affine, uint8_t *__restrict patch, unsigned int patchWidth, unsigned int patchHeight) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine. | |
FASTCV_API int | fcvTransformAffineu8_v2 (const uint8_t *__restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const float *__restrict position, const float *__restrict affine, uint8_t *__restrict patch, unsigned int patchWidth, unsigned int patchHeight, unsigned int patchStride) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine. | |
FASTCV_API void | fcvCopyRotated17x17u8 (const uint8_t *__restrict src, uint8_t *__restrict dst, int orientation) |
Extracts a 17x17 rotation corrected patch from a 25x25 image. | |
FASTCV_API void | fcvDWTHarrTransposeu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward Haar discrete wavelet transform on input image and transpose the result. | |
FASTCV_API void | fcvDWTHaarTransposeu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward Haar discrete wavelet transform on input image and transposes the result. | |
FASTCV_API void | fcvDWT53TabTransposes16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward 5-3 Tab discrete wavelet transform on input image and transposes the result. | |
FASTCV_API void | fcvIDWT53TabTransposes16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs inverse 5-3 Tab discrete wavelet transform on input image and transposes the result. | |
FASTCV_API void | fcvIDWTHarrTransposes16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Performs inverse Haar discrete wavelet transform on input image and transpose the result. | |
FASTCV_API void | fcvIDWTHaarTransposes16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Performs inverse Haar discrete wavelet transform on input image and transposes the result. | |
FASTCV_API void | fcvDWTHaaru8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward Haar discrete wavelet transform on input image. | |
FASTCV_API void | fcvDWT53Tabs16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward 5-3 Tab discrete wavelet transform on input image. | |
FASTCV_API void | fcvIDWT53Tabs16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs inverse 5-3 Tab discrete wavelet transform on input image. | |
FASTCV_API void | fcvIDWTHaars16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Performs inverse Haar discrete wavelet transform on input image. | |
FASTCV_API void | fcvDCTu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, int16_t *__restrict dst, uint32_t dstStride) |
Performs forward discrete Cosine transform on uint8_t pixels. | |
FASTCV_API void | fcvIDCTs16 (const int16_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Performs inverse discrete cosine transform on int16_t coefficients. | |
FASTCV_API void | fcvScaleUpPolyu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride) |
Perform image upscaling using polyphase filters. | |
FASTCV_API void | fcvScaleUpPolyInterleaveu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride) |
Interleaved image (CbCr or CrCb) upscaling using polyphase filters. | |
FASTCV_API void | fcvScaleDownMNu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride) |
Image downscaling using MN method NOTE: This MN downscalar supports up to 1/20x downscaling. | |
FASTCV_API void | fcvScaleDownMNInterleaveu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride) |
Interleaved image downscaling using MN method. | |
FASTCV_API void | fcvGetPerspectiveTransformf32 (const float32_t src1[8], const float32_t src2[8], float32_t transformCoefficient[9]) |
Calculates a perspective transform from four pairs of the corresponding points. NOTE: in order to guarantee a valid output transform, any three points in src1 or src2 cannot be collinear. | |
FASTCV_API void | fcvRemapRGBA8888NNu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, const float32_t *__restrict mapX, const float32_t *__restrict mapY, uint32_t mapStride) |
Applies a generic geometrical transformation to a 4-channel uint8 image. The interpolation method is nearest neighbor. | |
FASTCV_API void | fcvRemapRGBA8888BLu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, const float32_t *__restrict mapX, const float32_t *__restrict mapY, uint32_t mapStride) |
Applies a generic geometrical transformation to a 4-channel uint8 image with bilinear interpolation. | |
FASTCV_API void | fcvTransformAffineClippedu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const float32_t *__restrict affineMatrix, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint32_t *__restrict dstBorder) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels are sampled using bi-linear interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder. | |
FASTCV_API fcvStatus | fcvTransformAffineClippedu8_v2 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const float32_t *__restrict affineMatrix, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint32_t *__restrict dstBorder, fcvInterpolationType interpolation) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder. | |
FASTCV_API fcvStatus | fcvTransformAffineClippedu8_v3 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const float32_t *__restrict affineMatrix, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint32_t *__restrict dstBorder, fcvInterpolationType interpolation, fcvBorderType borderType, uint8_t borderValue) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder. | |
FASTCV_API void | fcv3ChannelTransformAffineClippedBCu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const float32_t *__restrict affineMatrix, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, uint32_t *__restrict dstBorder) |
Applies an affine transformation on a 3-color channel image using a 2x3 matrix using bicubic interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder. | |
FASTCV_API void | fcvScaleDownBLu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride) |
Image downscaling using bilinear method. | |
FASTCV_API fcvStatus | fcvTableLookupu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, const uint8_t *__restrict lut, uint8_t *__restrict dst, uint32_t dstStride) |
Applies a Table Look-up transformation to a single-channel uint8 image. | |
FASTCV_API fcvStatus | fcvWarpPerspectiveu8_v3 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, float *__restrict projectionMatrix, fcvInterpolationType interpolation) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. | |
FASTCV_API fcvStatus | fcvWarpPerspectiveu8_v4 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, float *__restrict projectionMatrix, fcvInterpolationType interpolation, fcvBorderType borderType, uint8_t borderValue) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. | |
FASTCV_API fcvStatus | fcvRemapu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, const float32_t *__restrict mapX, const float32_t *__restrict mapY, uint32_t mapStride, fcvInterpolationType interpolation) |
Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter. | |
FASTCV_API fcvStatus | fcvRemapu8_v2 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, const float32_t *__restrict mapX, const float32_t *__restrict mapY, uint32_t mapStride, fcvInterpolationType interpolation, fcvBorderType borderType, uint8_t borderValue) |
Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter. | |
FASTCV_API fcvStatus | fcvMagnitudes16 (const int16_t *__restrict src1, uint32_t width, uint32_t height, uint32_t src1Stride, const int16_t *__restrict src2, uint32_t src2Stride, int16_t *__restrict dst, uint32_t dstStride) |
Gradient Magnitude Computation from two int16_t type matrices. | |
FASTCV_API fcvStatus | fcvPhases16 (const int16_t *__restrict src1, uint32_t width, uint32_t height, uint32_t src1Stride, const int16_t *__restrict src2, uint32_t src2Stride, uint8_t *__restrict dst, uint32_t dstStride) |
Gradient Phase Computation from two int16_t type matrices. | |
FASTCV_API fcvStatus | fcvFFTu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, float32_t *__restrict dst, uint32_t dstStride) |
FASTCV_API fcvStatus | fcvIFFTf32 (const float32_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Computes the 1D or 2D Inverse Fast Fourier Transform of a matrix. | |
FASTCV_API fcvStatus | fcvScaleu8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, fcvInterpolationType interpolation) |
Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size. | |
FASTCV_API fcvStatus | fcvScaleu8_v2 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstWidth, uint32_t dstHeight, uint32_t dstStride, fcvInterpolationType interpolation, fcvBorderType borderType, uint8_t borderValue) |
Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size. | |
FASTCV_API fcvStatus | fcv2PlaneWarpPerspectiveu8 (const uint8_t *__restrict src1, const uint8_t *__restrict src2, uint32_t srcWidth, uint32_t srcHeight, uint32_t src1Stride, uint32_t src2Stride, uint8_t *__restrict dst1, uint8_t *__restrict dst2, uint32_t dstWidth, uint32_t dstHeight, uint32_t dst1Stride, uint32_t dst2Stride, float32_t *__restrict warpmatrix) |
Perspective warp two images using the same transformation. Bi-linear interpolation is used where applicable. | |
FASTCV_API fcvStatus | fcvScaleDownBy2Gaussian3x3u8 (const uint8_t *__restrict src, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcStride, uint8_t *__restrict dst, uint32_t dstStride) |
Downscale a grayscale image by a factor of two using a 3x3 Gaussian filter kernel. |
Warp perspective, affine transformations
FASTCV_API fcvStatus fcv2PlaneWarpPerspectiveu8 | ( | const uint8_t *__restrict | src1, |
const uint8_t *__restrict | src2, | ||
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | src1Stride, | ||
uint32_t | src2Stride, | ||
uint8_t *__restrict | dst1, | ||
uint8_t *__restrict | dst2, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dst1Stride, | ||
uint32_t | dst2Stride, | ||
float32_t *__restrict | warpmatrix | ||
) |
Perspective warp two images using the same transformation. Bi-linear interpolation is used where applicable.
Perspective warp two images (or buffer) using the same transformation in one function call. This can be used, for example, to warp a grayscale image and an alpha image at the same time, or warp two color channels (for example u and v de-interleaved for YUV).
src1 | First input 8-bit image. Size of buffer is src1Stride*srcHeight bytes. |
src2 | Second input 8-bit image. Size of buffer is src2Stride*srcHeight bytes. |
srcWidth | Input image width. |
srcHeight | Input image height. |
src1Stride | Input image 1 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to srcWidth. |
src2Stride | Input image 2 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to srcWidth. |
dst1 | First warped output image (correspond to src1). Size of buffer is dst1Stride*dstHeight bytes. |
dst2 | Second warped output image (correspond to src2). Size of buffer is dst2Stride*dstHeight bytes. |
dstWidth | Dst image width. |
dstHeight | Dst image height. |
dst1Stride | Output image 1 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to dstWidth. |
dst2Stride | Output image 2 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to dstWidth. |
warpmatrix | 3x3 perspective transformation matrix (generally a homography). |
FASTCV_API void fcv3ChannelTransformAffineClippedBCu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const float32_t *__restrict | affineMatrix, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
uint32_t *__restrict | dstBorder | ||
) |
Applies an affine transformation on a 3-color channel image using a 2x3 matrix using bicubic interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.
src | Input image. Size of buffer is srcStride*srcHeight bytes. WARNING: data should be 128-bit aligned. |
srcWidth | Input image width. |
srcHeight | Input 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. NOTE: if 0, srcStride is set as srcWidth*3. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth*3 if not 0. |
affineMatrix | 2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | Warning: the convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there's unexpected result, it could be due to different rotation convention. If that's the case, negate the angle before calculating transform matrix. |
The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
dst | Warped output image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Output image width. |
dstHeight | Output 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. NOTE: if 0, dstStride is set as dstWidth*3. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth*3 if not 0. NOTE: data should be 128-bit aligned. |
dstBorder | Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,... where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2*dstHeight integers in size. NOTE: data should be 128-bit aligned. |
FASTCV_API void fcv3ChannelWarpPerspectiveu8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
float *__restrict | projectionMatrix | ||
) |
Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcv3ChannelWarpPerspectiveu8_v2(). In the 2.0.0 release, fcv3ChannelWarpPerspectiveu8_v2 will be renamed to fcv3ChannelWarpPerspectiveu8 and the signature of fcv3ChannelWarpPerspectiveu8 as it appears now, will be removed.
src | Input image. Size of buffer is srcWidth*srcHeight*3 bytes. NOTE: data should be 128-bit aligned. |
srcWidth | Input image width. NOTE: should be multiple of 8 |
srcHeight | Input image height. NOTE: should be multiple of 8 |
dst | Warped output image. Size of buffer is dstWidth*dstHeight*3 bytes. NOTE: data should be 128-bit aligned. |
dstWidth | Output image width. NOTE: should be multiple of 8. |
dstHeight | Output image height. NOTE: should be multiple of 8. |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
FASTCV_API void fcv3ChannelWarpPerspectiveu8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
unsigned int | dstStride, | ||
float *__restrict | projectionMatrix | ||
) |
Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation.
ATTENTION: This function is a duplication of fcv3ChannelWarpPerspectiveu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcv3ChannelWarpPerspectiveu8, fcv3ChannelWarpPerspectiveu8_v2 will be removed, and the current signature for fcv3ChannelWarpPerspectiveu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcv3ChannelWarpPerspectiveu8 when transitioning to 2.0.0.
src | Input image. Size of buffer is srcStride*srcHeight bytes. WARNING: data should be 128-bit aligned. |
srcWidth | Input image width. WARNING: should be multiple of 8 |
srcHeight | Input image height. WARNING: should be multiple of 8 |
srcStride | Input image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth*3. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth*3 if not 0. |
dst | Warped output image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Output image width. WARNING: should be multiple of 8. |
dstHeight | Output image height. WARNING: should be multiple of 8. |
dstStride | Output image stride (in bytes). NOTE: if 0, dstStride is set as dstWidth*3. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth*3 if not 0. |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
FASTCV_API void fcvCopyRotated17x17u8 | ( | const uint8_t *__restrict | src, |
uint8_t *__restrict | dst, | ||
int | orientation | ||
) |
Extracts a 17x17 rotation corrected patch from a 25x25 image.
src | 25x25 input image in continuous memory. |
dst | 17x17 output patch. |
orientation | Rotation angle of patch relative to src. 10-bit fixed-point angle around unit circle. NOTE: 0 = 0 degrees and 1024 = 360 degrees. |
FASTCV_API void fcvDCTu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward discrete Cosine transform on uint8_t pixels.
This function performs 8x8 forward discrete Cosine transform on input image
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvDWT53Tabs16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward 5-3 Tab discrete wavelet transform on input image.
This function performs forward discrete wavelet transform on the input image using 5-3 Tab kernel.
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvDWT53TabTransposes16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward 5-3 Tab discrete wavelet transform on input image and transposes the result.
This function performs forward discrete wavelet transform on input image using the 5-tab low pass filter and the 3-tab high pass filter: 5-tab low pass: [ -1/8 1/4 3/4 1/4 -1/8 ] * 2^(1/2) 3-tab high pass: [ -1/2 1 -1/2 ] * 2^(-1/2) This function also transposes the result.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Output image that has been transformed and transposed NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvDWTHaarTransposeu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward Haar discrete wavelet transform on input image and transposes the result.
This function performs forward discrete wavelet transform on input image using the Haar kernel: Low pass: [ 1 1 ] * 2^(-1/2) High pass: [ 1 -1 ] * 2^(-1/2) This function also transposes the result.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image that has been transformed and transposed NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvDWTHaaru8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward Haar discrete wavelet transform on input image.
This function performs forward discrete wavelet transform on the input image using Haar kernel.
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvDWTHarrTransposeu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs forward Haar discrete wavelet transform on input image and transpose the result.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvDWTHaarTransposeu8(). In the 2.0.0 release, the signature of fcvDWTHarrTransposeu8 as it appears now, will be removed.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API fcvStatus fcvFFTu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
float32_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Computes the 1D or 2D Fast Fourier Transform of a matrix.
Computes the 1D or 2D Fast Fourier Transform of a real valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.
src | An 8 bit unsigned real valued input matrix. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2. NOTE: array should be 128-bit aligned |
srcWidth | Width of the source matrix. NOTE: Must be a power of 2 |
srcHeight | Height of the source matrix. NOTE: Must be a power of 2 for the 2D case, and must be set to 1 for the 1D case |
srcStride | Stride of the input matrix. Stride 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 set to srcWidth. WARNING: should be multiple of 8 |
dst | The computed FFT matrix. The FFT coefficients are stored in interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on. Hence the dimensions of the dst are (2 x srcWidth, srcHeight) NOTE: array should be 128-bit aligned |
dstStride | Stride of the output matrix. Stride 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 set to 2 x srcWidth x sizeof(float32_t). WARNING: should be multiple of 8 |
FASTCV_API void fcvGetPerspectiveTransformf32 | ( | const float32_t | src1[8], |
const float32_t | src2[8], | ||
float32_t | transformCoefficient[9] | ||
) |
Calculates a perspective transform from four pairs of the corresponding points. NOTE: in order to guarantee a valid output transform, any three points in src1 or src2 cannot be collinear.
src1 | Coordinates of quadrangle vertices in the source image |
src2 | Coordinates of the corresponding quadrangle vertices in the destination image |
transformCoefficient | 3x3 matrix of a perspective transform |
FASTCV_API void fcvIDCTs16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse discrete cosine transform on int16_t coefficients.
This function performs 8x8 inverse discrete Cosine transform on input image
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth. NOTE: should be a multiple of 8. |
FASTCV_API void fcvIDWT53Tabs16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse 5-3 Tab discrete wavelet transform on input image.
This function performs inverse discrete wavelet transform on the input image using 5-3 Tab kernel.
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvIDWT53TabTransposes16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse 5-3 Tab discrete wavelet transform on input image and transposes the result.
This function performs inverse discrete wavelet transform on input image using the 3-tab low pass filter and the 5-tab high pass filter: 3-tab low pass: [ -1/2 1 -1/2 ] * 2^(-1/2) 5-tab high pass: [ -1/8 1/4 3/4 1/4 -1/8 ] * 2^(1/2) This function also transposes the result.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Output image that has been transformed and transposed NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
FASTCV_API void fcvIDWTHaars16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse Haar discrete wavelet transform on input image.
This function performs inverse discrete wavelet transform on the input image using Haar kernel.
src | Pointer to input single plane image NOTE: should be 128-bit aligned. |
srcWidth | Width of the input image NOTE: should be a multiple of 8. |
srcHeight | Height of the input image |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Pointer to output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth. NOTE: should be a multiple of 8. |
FASTCV_API void fcvIDWTHaarTransposes16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse Haar discrete wavelet transform on input image and transposes the result.
This function performs inverse discrete wavelet transform on input image using the Haar kernel: Low pass: [ 1 1 ] * 2^(-1/2) High pass: [ 1 -1 ] * 2^(-1/2) This function also transposes the result.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Output image that has been transformed and transposed NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth. NOTE: should be a multiple of 8. |
FASTCV_API void fcvIDWTHarrTransposes16 | ( | const int16_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Performs inverse Haar discrete wavelet transform on input image and transpose the result.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvIDWTHaarTransposes16(). In the 2.0.0 release, the signature of fcvIDWTHarrTransposes16 as it appears now, will be removed.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Image width NOTE: should be a multiple of 8. |
srcHeight | Image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * sizeof(int16_t). NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth. NOTE: should be a multiple of 8. |
FASTCV_API fcvStatus fcvIFFTf32 | ( | const float32_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Computes the 1D or 2D Inverse Fast Fourier Transform of a matrix.
Computes the 1D or 2D Inverse Fast Fourier Transform of a complex valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.
src | An 32 bit floating point complex valued input matrix. The data in the matrix must be stored in an interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2. NOTE: array should be 128-bit aligned |
srcWidth | Width of the source matrix. The width here is the number of floating point units in the matrix. Since the data is interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on, the width is the total number of real and complex units in the matrix. For example, if the Matrix has data values Re1 Im1 Re2 Im2 Re3 Im3 Re4 Im4, then the width here is 8 units. NOTE: Must be a power of 2 |
srcHeight | Height of the source matrix. NOTE: Must be a power of 2 for the 2D case, and must be set to 1 for the 1D case |
srcStride | Stride of the input matrix. Stride 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 set to srcWidth x sizeof(float32_t). WARNING: should be multiple of 8 |
dst | The computed IFFT matrix. The matrix is real valued and has no imaginary components. Hence the dimensions of the dst are (srcWidth / 2 , srcHeight) NOTE: array should be 128-bit aligned |
dstStride | Stride of the output matrix. Stride 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 set to (srcWidth / 2). WARNING: should be multiple of 8 |
FASTCV_API fcvStatus fcvMagnitudes16 | ( | const int16_t *__restrict | src1, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | src1Stride, | ||
const int16_t *__restrict | src2, | ||
uint32_t | src2Stride, | ||
int16_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Gradient Magnitude Computation from two int16_t type matrices.
The function takes two gradient matrices in int16_t and computes the magnitude in int16_t.
NOTE: Saturation is used when computed magnitude value is larger than max limit of int16_t.
src1 | The gradient matrix in X direction. NOTE: array should be 128-bit aligned |
width | Width of the source matrix. |
height | Height of the source matrix. |
src1Stride | Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src1Stride is default to width*2. WARNING: should be multiple of 8 |
src2 | The gradient matrix in Y direction. NOTE: array should be 128-bit aligned |
src2Stride | Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src2Stride is default to width*2. WARNING: should be multiple of 8 |
dst | the result matrix (int16_t type). NOTE: array should be 128-bit aligned |
dstStride | Stride 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 width*2. WARNING: should be multiple of 8 |
FASTCV_API fcvStatus fcvPhases16 | ( | const int16_t *__restrict | src1, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | src1Stride, | ||
const int16_t *__restrict | src2, | ||
uint32_t | src2Stride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Gradient Phase Computation from two int16_t type matrices.
The function takes two gradient matrices in int16_t and computes the phase for each pixel, storing results in a uint8_t matrix. The phase angle is translated to [0, 2*PI) and then mapped to range [0, 255).
src1 | The gradient matrix in X direction. NOTE: array should be 128-bit aligned |
width | Width of the source matrix. |
height | Height of the source matrix. |
src1Stride | Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src1Stride is default to width*2. WARNING: should be multiple of 8 |
src2 | The gradient matrix in Y direction. NOTE: array should be 128-bit aligned |
src2Stride | Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src2Stride is default to width*2. WARNING: should be multiple of 8 |
dst | the result matrix (uint8_t type). NOTE: array should be 128-bit aligned |
dstStride | Stride 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 width. WARNING: should be multiple of 8 |
FASTCV_API void fcvRemapRGBA8888BLu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
const float32_t *__restrict | mapX, | ||
const float32_t *__restrict | mapY, | ||
uint32_t | mapStride | ||
) |
Applies a generic geometrical transformation to a 4-channel uint8 image with bilinear interpolation.
The brightness of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.
src | Input uint8_t image. The size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | Input image width. NOTE: should be a multiple of 8. |
srcHeight | Input image height. |
srcStride | Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth*4. NOTE: should be a multiple of 8. |
dst | Output image which has the same type, and size as the input image. The size of buffer is dstStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
dstWidth | Output image width. |
dstHeight | Output image height. |
dstStride | Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride equals to 0, it will be set to dstWidth*4. NOTE: should be a multiple of 8. |
mapX | a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapY | a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapStride | the stride of the mapX and mapY if mapStride equals to 0, it will be set to dstWidth*4. NOTE: should be a multiple of 8. |
FASTCV_API void fcvRemapRGBA8888NNu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
const float32_t *__restrict | mapX, | ||
const float32_t *__restrict | mapY, | ||
uint32_t | mapStride | ||
) |
Applies a generic geometrical transformation to a 4-channel uint8 image. The interpolation method is nearest neighbor.
The brightness of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.
src | Input uint8_t image. The size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | Input image width. NOTE: should be a multiple of 8. |
srcHeight | Input image height. |
srcStride | Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth*4. NOTE: should be a multiple of 8. |
dst | Output image which has the same type, and size as the input image. The size of buffer is dstStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
dstWidth | Output image width. |
dstHeight | Output image height. |
dstStride | Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth*4. NOTE: should be a multiple of 8. |
mapX | a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapY | a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapStride | the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth*4. NOTE: should be a multiple of 8. |
FASTCV_API fcvStatus fcvRemapu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
const float32_t *__restrict | mapX, | ||
const float32_t *__restrict | mapY, | ||
uint32_t | mapStride, | ||
fcvInterpolationType | interpolation | ||
) |
Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter.
The greyscale of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.
src | Input uint8_t image. The size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | Input image width. NOTE: should be a multiple of 8. |
srcHeight | Input image height. |
srcStride | Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image which has the same type, and size as the input image. The size of buffer is dstStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
dstWidth | Output image width. |
dstHeight | Output image height. |
dstStride | Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth. NOTE: should be a multiple of 8. |
mapX | a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapY | a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapStride | the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth*sizeof(float32_t). NOTE: should be a multiple of 8. |
interpolation | the interpolation method to derive the dst pixel value. supported methods are nearest neighbor, bilinear and area. |
FASTCV_API fcvStatus fcvRemapu8_v2 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
const float32_t *__restrict | mapX, | ||
const float32_t *__restrict | mapY, | ||
uint32_t | mapStride, | ||
fcvInterpolationType | interpolation, | ||
fcvBorderType | borderType, | ||
uint8_t | borderValue | ||
) |
Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter.
ATTENTION: This function is a duplication of fcvRemapu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvRemapu8, fcvRemapu8_v2 will be removed, and the current signature for fcvRemapu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvRemapu8 when transitioning to 2.0.0.
The greyscale of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.
src | Input uint8_t image. The size of buffer is srcStride*srcHeight bytes. NOTE: should be 128-bit aligned. |
srcWidth | Input image width. NOTE: should be a multiple of 8. |
srcHeight | Input image height. |
srcStride | Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image which has the same type, and size as the input image. The size of buffer is dstStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
dstWidth | Output image width. |
dstHeight | Output image height. |
dstStride | Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth. NOTE: should be a multiple of 8. |
mapX | a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapY | a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride*dstHeight bytes. NOTE: should be 128-bit aligned. |
mapStride | the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth*sizeof(float32_t). NOTE: should be a multiple of 8. |
interpolation | the interpolation method to derive the dst pixel value. supported methods are nearest neighbor, bilinear and area. |
borderType | The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV_BORDER_UNDEFINED and FASTCV_BORDER_CONSTANT. |
borderValue | The user-specified constant pixel value, in case FASTCV_BORDER_CONSTANT is chosen for borderType. |
FASTCV_API int fcvScaleDown3To2u8 | ( | const uint8_t *__restrict | src, |
unsigned | srcWidth, | ||
unsigned | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstStride | ||
) |
Downscale the image to 2/3 width and height by averaging 3x3 pixels into one..
A 3x3 downsampling box filter across adjacent pixels is applied.
src | Input 8-bit image. WARNING: should be 128-bit aligned. |
srcWidth | Image width. NOTE: In case of non multiple of 3, it will crop to the closest multiple of 3 |
srcHeight | Image height. NOTE: In case of non multiple of 3, it will crop to the closest multiple of 3 |
srcStride | Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, srcStride is set to srcWidth. |
dst | Output 8-bit image. WARNING: should be 128-bit aligned. Memory must be pre-allocated at least srcWidth * srcHeight * 2 / 3 dstWidth = srcWidth/3*2 dstHeight = srcHeight/3*2 |
dstStride | Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth *2/3. |
FASTCV_API void fcvScaleDownBLu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride | ||
) |
Image downscaling using bilinear method.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Input image width |
srcHeight | Input image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstWidth | Output image width |
dstHeight | Output image height |
dstStride | Stride of image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth. NOTE: should be a multiple of 8. |
FASTCV_API fcvStatus fcvScaleDownBy2Gaussian3x3u8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Downscale a grayscale image by a factor of two using a 3x3 Gaussian filter kernel.
This function first blurs the input image using a 3x3 Gaussian kernel, and then downsamples the image by selecting every other row and column. The dimensions of the destination image are computed as follows : dstWidth = (srcWidth + 1)/2 , dstHeight = (srcHeight + 1)/2
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Width of the input image. |
srcHeight | Height of the input image |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Output 8-bit downscale image of size (srcWidth + 1) / 2 x (srcHeight + 1) / 2. NOTE: border values have been taken care of w.r.t. the pixel coordinate. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as (srcWidth+1)/2. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as (srcWidth+1)/2 if not 0. |
FASTCV_API void fcvScaleDownBy2Gaussian5x5u8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst | ||
) |
Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvScaleDownBy2Gaussian5x5u8_v2(). In the 2.0.0 release, fcvScaleDownBy2Gaussian5x5u8_v2 will be renamed to fcvScaleDownBy2Gaussian5x5u8 and the signature of fcvScaleDownBy2Gaussian5x5u8 as it appears now, will be removed.
Downsamples the image using a 5x5 Gaussian filter kernel.
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. NOTE: should be multiple of 8 |
srcHeight | Image height. NOTE:must be a multiple of 2 |
dst | Output 8-bit downscale image of size (width / 2) x (height / 2). NOTE: border values have been taken cared w.r.t. the pixel coordinate. |
FASTCV_API void fcvScaleDownBy2Gaussian5x5u8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstStride | ||
) |
Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.
ATTENTION: This function is a duplication of fcvScaleDownBy2Gaussian5x5u8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleDownBy2Gaussian5x5u8, fcvScaleDownBy2Gaussian5x5u8_v2 will be removed, and the current signature for fcvScaleDownBy2Gaussian5x5u8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvScaleDownBy2Gaussian5x5u8 when transitioning to 2.0.0.
Downsamples the image using a 5x5 Gaussian filter kernel.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. NOTE: should be multiple of 8 |
srcHeight | Image height. |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Output 8-bit downscale image of size (width / 2) x (height / 2). NOTE: border values have been taken cared w.r.t. the pixel coordinate. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as srcWidth/2. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/2 if not 0. |
FASTCV_API int fcvScaleDownBy2u8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst | ||
) |
Down-scale the image to half width and height by averaging 2x2 pixels into one.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvScaleDownBy2u8_v2(). In the 2.0.0 release, fcvScaleDownBy2u8_v2 will be renamed to fcvScaleDownBy2u8 and the signature of fcvScaleDownBy2u8 as it appears now, will be removed.
A box filter downsampling the next pixel, the pixel below, and the next pixel to the pixel below into one pixel.
| px00 px01 px02 px03 |
| px10 px11 px12 px13 |
to:
| (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. NOTE: data should be 128-bit aligned. |
srcWidth | Image width. WARNING: should be multiple of 8. |
srcHeight | Image height. NOTE:must be a multiple of 2 |
dst | Output 8-bit image. Size of buffer is srcWidth*srcHeight/4 bytes. NOTE: data should be 128-bit aligned. |
FASTCV_API int fcvScaleDownBy2u8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstStride | ||
) |
Down-scale the image to half width and height by averaging 2x2 pixels into one.
ATTENTION: This function is a duplication of fcvScaleDownBy2u8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleDownBy2u8, fcvScaleDownBy2u8_v2 will be removed, and the current signature for fcvScaleDownBy2u8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvScaleDownBy2u8 when transitioning to 2.0.0.
A box filter downsampling the next pixel, the pixel below, and the next pixel to the pixel below into one pixel.
| px00 px01 px02 px03 |
| px10 px11 px12 px13 |
to:
| (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. NOTE: data should be 128-bit aligned. |
srcWidth | Image width. WARNING: should be multiple of 8. |
srcHeight | Image height. NOTE:must be a multiple of 2 |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Output 8-bit image. Size of buffer is dstStride*srcHeight/2 bytes. NOTE: data should be 128-bit aligned. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as srcWidth/2. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/2 if not 0. |
FASTCV_API int fcvScaleDownBy4u8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst | ||
) |
Downscale the image to quarter width and height by averaging 4x4 pixels into one..
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvScaleDownBy4u8_v2(). In the 2.0.0 release, fcvScaleDownBy4u8_v2 will be renamed to fcvScaleDownBy4u8 and the signature of fcvScaleDownBy4u8 as it appears now, will be removed.
A 4x4 downsampling box filter across adjacent pixels is applied.
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. NOTE: should be multiple of 8 |
srcHeight | Image height. NOTE:must be a multiple of 4 |
dst | Output 8-bit image. Size of buffer is srcWidth*srcHeight/16 bytes. WARNING: should be 128-bit aligned. |
FASTCV_API int fcvScaleDownBy4u8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstStride | ||
) |
Downscale the image to quarter width and height by averaging 4x4 pixels into one..
ATTENTION: This function is a duplication of fcvScaleDownBy4u8_v2() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleDownBy4u8_v2, fcvScaleDownBy4u8_v2 will be removed, and the current signature for fcvScaleDownBy4u8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvScaleDownBy4u8 when transitioning to 2.0.0.
A 4x4 downsampling box filter across adjacent pixels is applied.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. NOTE: should be multiple of 8 |
srcHeight | Image height. NOTE:must be a multiple of 4 |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Output 8-bit image. Size of buffer is dstStride*srcHeight/4 bytes. WARNING: should be 128-bit aligned. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as srcWidth/4. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth/4 if not 0. |
FASTCV_API void fcvScaleDownMNInterleaveu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride | ||
) |
Interleaved image downscaling using MN method.
The M over N downscale algorithm works on an arbitrary length (N) of input data, and generates another arbitrary length (M) of output data, with the output length M less or equal to the input length N.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Input image width, number of (CrCb/CbCr) pair NOTE: should be a multiple of 8. |
srcHeight | Input image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * 2. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstWidth | Output image width , number of (CrCb/CbCr) pair NOTE: should be a multiple of 8. |
dstHeight | Output image height |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth * 2. NOTE: should be a multiple of 8. |
FASTCV_API void fcvScaleDownMNu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride | ||
) |
Image downscaling using MN method
NOTE: This MN downscalar supports up to 1/20x downscaling.
The M over N downscale algorithm works on an arbitrary length (N) of input data, and generates another arbitrary length (M) of output data, with the output length M less or equal to the input length N.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Input image width |
srcHeight | Input image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstWidth | Output image width |
dstHeight | Output image height |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, dstStride is default to dstWidth. NOTE: should be a multiple of 8. |
FASTCV_API int fcvScaleDownNNu8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
unsigned int | dstStride | ||
) |
Downsample Horizontaly and/or Vertically by an *integer* scale.
Uses Nearest Neighbor method
src | Input 8-bit image. WARNING: should be 128-bit aligned. |
srcWidth | Source Image width. WARNING: should be multiple of 8. |
srcHeight | Source Image height. |
srcStride | Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, srcStride is set to srcWidth. |
dst | Output 8-bit image. WARNING: should be 128-bit aligned. |
dstWidth | Destination Image width. |
dstHeight | Destination Image height. |
dstStride | Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth *2/3. |
FASTCV_API void fcvScaleDownu8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight | ||
) |
Downsample Horizontaly and/or Vertically by an *integer* scale.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvScaleDownu8_v2(). In the 2.0.0 release, fcvScaleDownu8_v2 will be renamed to fcvScaleDownu8 and the signature of fcvScaleDownu8 as it appears now, will be removed.
Uses an box averaging filter of size MxN where M is the scale factor in horizontal dimension and N is the scale factor in the vertical dimension.
NOTE: input dimensions should be multiple of output dimensions.
NOTE: On different processors, some output pixel values may be off by 1
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Source Image width. WARNING: should be multiple of 8. |
srcHeight | Source Image height. |
dst | Output 8-bit image. Size of buffer is dstWidth*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Destination Image width. |
dstHeight | Destination Image height. |
FASTCV_API void fcvScaleDownu8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
unsigned int | dstStride | ||
) |
Downsample Horizontaly and/or Vertically by an *integer* scale.
ATTENTION: This function is a duplication of fcvScaleDownu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleDownu8, fcvScaleDownu8_v2 will be removed, and the current signature for fcvScaleDownu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvScaleDownu8 when transitioning to 2.0.0.
Uses an box averaging filter of size MxN where M is the scale factor in horizontal dimension and N is the scale factor in the vertical dimension
NOTE: input dimensions should be multiple of output dimensions.
NOTE: On different processors, some output pixel values may be off by 1
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Source Image width. WARNING: should be multiple of 8. |
srcHeight | Source Image height. |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Output 8-bit image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Destination Image width. |
dstHeight | Destination Image height. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as dstWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. |
FASTCV_API fcvStatus fcvScaleu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
fcvInterpolationType | interpolation | ||
) |
Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size.
Scale up or down the source image of size srcWidth-by-srcHeight to the destination image of size dstWidth-by-dstHeight. NOTE: dstWidth > 0 && dstHeight > 0.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Source Image width. WARNING: should be multiple of 8. |
srcHeight | Source Image height. |
srcStride | Stride of source image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, srcStride=srcWidth as default |
dst | Output 8-bit image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Destination Image width. |
dstHeight | Destination Image height. |
dstStride | Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, dstStride=dstWidth as default |
interpolation | The interpolation method used for scaling. Please see fcvInterpolationType. FASTCV_INTERPOLATION_TYPE_NEAREST_NEIGHBOR: Nearest neighbor interpolation. FASTCV_INTERPOLATION_TYPE_BILINEAR: Bilinear interpolation. FASTCV_INTERPOLATION_TYPE_AREA: Interpolation by area. Output values are determined by weighted averages of the source pixels covered by the destination pixel. The averaging weight for each source pixel is proportional to its area overlapping with the destination pixel. Interpolation by area may produce more precise images for scale down operations. |
FASTCV_API fcvStatus fcvScaleu8_v2 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
fcvInterpolationType | interpolation, | ||
fcvBorderType | borderType, | ||
uint8_t | borderValue | ||
) |
Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size.
ATTENTION: This function is a duplication of fcvScaleu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleu8, fcvScaleu8_v2 will be removed, and the current signature for fcvScaleu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvWarpPerspectiveu8 when transitioning to 2.0.0.
Scale up or down the source image of size srcWidth-by-srcHeight to the destination image of size dstWidth-by-dstHeight. NOTE: dstWidth > 0 && dstHeight > 0.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Source Image width. WARNING: should be multiple of 8. |
srcHeight | Source Image height. |
srcStride | Stride of source image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, srcStride=srcWidth as default |
dst | Output 8-bit image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Destination Image width. |
dstHeight | Destination Image height. |
dstStride | Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, dstStride=dstWidth as default |
interpolation | The interpolation method used for scaling. Please see fcvInterpolationType. FASTCV_INTERPOLATION_TYPE_NEAREST_NEIGHBOR: Nearest neighbor interpolation. FASTCV_INTERPOLATION_TYPE_BILINEAR: Bilinear interpolation. FASTCV_INTERPOLATION_TYPE_AREA: Interpolation by area. Output values are determined by weighted averages of the source pixels covered by the destination pixel. The averaging weight for each source pixel is proportional to its area overlapping with the destination pixel. Interpolation by area may produce more precise images for scale down operations. |
borderType | The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV_BORDER_UNDEFINED, FASTCV_BORDER_CONSTANT and FASTCV_BORDER_REPLICATE. |
borderValue | The user-specified constant pixel value, in case FASTCV_BORDER_CONSTANT is chosen for borderType. |
FASTCV_API void fcvScaleUpBy2Gaussian5x5u8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst | ||
) |
Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvScaleUpBy2Gaussian5x5u8_v2(). In the 2.0.0 release, fcvScaleUpBy2Gaussian5x5u8_v2 will be renamed to fcvScaleUpBy2Gaussian5x5u8 and the signature of fcvScaleUpBy2Gaussian5x5u8 as it appears now, will be removed.
Upsamples the image using a 5x5 Gaussian filter kernel. /n/b NOTE: border values have been taken care with Gaussion coefficients.
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. WARNING: should be multiple of 8. |
srcHeight | Image height. |
dst | Output 8-bit upsampled image of size (2*width) x (2*height). WARNING: should be 128-bit aligned. |
FASTCV_API void fcvScaleUpBy2Gaussian5x5u8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstStride | ||
) |
Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.
ATTENTION: This function is a duplication of fcvScaleUpBy2Gaussian5x5u8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvScaleUpBy2Gaussian5x5u8, fcvScaleUpBy2Gaussian5x5u8_v2 will be removed, and the current signature for fcvScaleUpBy2Gaussian5x5u8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvScaleUpBy2Gaussian5x5u8 when transitioning to 2.0.0.
Upsamples the image using a 5x5 Gaussian filter kernel. /n/b NOTE: border values have been taken care with Gaussion coefficients.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Image width. WARNING: should be multiple of 8. |
srcStride | Image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
srcHeight | Image height. |
dst | Output 8-bit upsampled image of size (2*dstStride) x (2*srcHeight). WARNING: should be 128-bit aligned. |
dstStride | Output stride (in bytes). NOTE: if 0, dstStride is set as srcWidth*2. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth*2 if not 0. |
FASTCV_API void fcvScaleUpPolyInterleaveu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride | ||
) |
Interleaved image (CbCr or CrCb) upscaling using polyphase filters.
Perform interleaved image (CbCr or CrCb) upscaling using polyphase filters. Data type is unsigned byte.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Input image width, number of (CrCb/CbCr) pairs NOTE: should be a multiple of 8. |
srcHeight | Input image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth * 2. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstWidth | Output image width, number of (CrCb/CbCr) pairs NOTE: should be a multiple of 8. |
dstHeight | Output image height |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth * 2. NOTE: should be a multiple of 8. |
FASTCV_API void fcvScaleUpPolyu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride | ||
) |
Perform image upscaling using polyphase filters.
Perform image upscaling using polyphase filters. The image data type is unsigned byte.
src | Input image NOTE: should be 128-bit aligned. |
srcWidth | Input image width NOTE: should be a multiple of 8. |
srcHeight | Input image height |
srcStride | Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. NOTE: should be a multiple of 8. |
dst | Output image NOTE: should be 128-bit aligned. |
dstWidth | Output image width NOTE: should be a multiple of 8. |
dstHeight | Output image height |
dstStride | Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth. NOTE: should be a multiple of 8. |
FASTCV_API fcvStatus fcvTableLookupu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const uint8_t *__restrict | lut, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstStride | ||
) |
Applies a Table Look-up transformation to a single-channel uint8 image.
Each pixel in the input image is used to index into a look-up table and the indexed look-up table value is then put into the output image
src | Input uint8_t image. The size of buffer is srcStride*srcHeight bytes NOTE: should be 128-bit aligned |
srcWidth | Input image width |
srcHeight | Input image height |
srcStride | Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth NOTE: should be a multiple of 8 |
lut | The Look-up Table given as a 256-element array of type uint8_t |
dst | Output image which has the same dimension as the input image in uint8_t type NOTE: should be 128-bit aligned |
dstStride | Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to srcWidth NOTE: should be a multiple of 8 |
FASTCV_API int fcvTransformAffine8x8u8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
const int32_t *__restrict | nPos, | ||
const int32_t *__restrict | nAffine, | ||
uint8_t *__restrict | nPatch | ||
) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvTransformAffine8x8u8_v2(). In the 2.0.0 release, fcvTransformAffine8x8u8_v2 will be renamed to fcvTransformAffine8x8u8 and the signature of fcvTransformAffine8x8u8 as it appears now, will be removed.
src | Input image. Size of buffer is srcWidth*srcHeight bytes. |
srcWidth | Image width. |
srcHeight | Image height. |
nPos[ | 2 ] Position in the image in 32 bit fixed point (Q16) NOTE: if any 1 coordinates of the warped square are inside the image, return 1 and leave function. Otherwise, return 0. WARNING: must be 64-bit aligned. |
nAffine[ | 2 ][ 2 ] Transformation matrix in 32 bit fixed point (Q16). The matrix stored in nAffine is using row major ordering: a11, a12, a21, a22 where the matrix is: | a11, a12 | | a21, a22 | |
WARNING: should be 128-bit aligned.
nPatch | Transformed patch. |
FASTCV_API int fcvTransformAffine8x8u8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
const int32_t *__restrict | nPos, | ||
const int32_t *__restrict | nAffine, | ||
uint8_t *__restrict | patch, | ||
unsigned int | patchStride | ||
) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine.
ATTENTION: This function is a duplication of fcvTransformAffine8x8u8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvTransformAffine8x8u8, fcvTransformAffine8x8u8_v2 will be removed, and the current signature for fcvTransformAffine8x8u8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvTransformAffine8x8u8 when transitioning to 2.0.0.
src | Input image. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Image width. |
srcHeight | Image height. |
srcStride | Stride of image (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. NOTE: if 0, srcStride is set as srcWidth. WARNING: must be at least as much as srcWidth if not 0. |
nPos[ | 2 ] Position in the image in 32 bit fixed point (Q16) NOTE: if any 1 coordinates of the warped square are inside the image, return 1 and leave function. Otherwise, return 0. WARNING: must be 64-bit aligned. |
nAffine[ | 2 ][ 2 ] Transformation matrix in 32 bit fixed point (Q16). The matrix stored in nAffine is using row major ordering: a11, a12, a21, a22 where the matrix is: | a11, a12 | | a21, a22 | |
WARNING: should be 128-bit aligned.
patch | Transformed patch. |
patchStride | Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. NOTE: if 0, srcStride is set as 8. WARNING: must be at least as much as 8 if not 0. |
FASTCV_API void fcvTransformAffineClippedu8 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const float32_t *__restrict | affineMatrix, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
uint32_t *__restrict | dstBorder | ||
) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels are sampled using bi-linear interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvTransformAffineClippedu8_v2(). In the 2.0.0 release, fcvTransformAffineClippedu8_v2 will be renamed to fcvTransformAffineClippedu8 and the signature of fcvTransformAffineClippedu8 as it appears now, will be removed.
src | Input 8-bit image. NOTE: data should be 128-bit aligned. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Input image width. The number of pixels in a row. |
srcHeight | Input 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. |
affineMatrix | 2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | |
Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there's unexpected result, it could be due to different rotation convention. If that's the case, negate the angle before calculating transform matrix.
The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
NOTE: data should be 128-bit aligned.
dst | Transformed output 8-bit image. NOTE: data should be 128-bit aligned. |
dstWidth | Dst image width. |
dstHeight | Dst 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. NOTE: should be a multiple of 8. |
dstBorder | Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,... where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2*dstHeight integers in size. If dstBorder is set as NULL, then the border isn't processed. NOTE: data should be 128-bit aligned. |
FASTCV_API fcvStatus fcvTransformAffineClippedu8_v2 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const float32_t *__restrict | affineMatrix, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
uint32_t *__restrict | dstBorder, | ||
fcvInterpolationType | interpolation | ||
) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.
ATTENTION: This function is a duplication of fcvTransformAffineClippedu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvTransformAffineClippedu8, fcvTransformAffineClippedu8_v2 will be removed, and the current signature for fcvTransformAffineClippedu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvTransformAffineClippedu8 when transitioning to 2.0.0.
src | Input 8-bit image. NOTE: data should be 128-bit aligned. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Input image width. The number of pixels in a row. |
srcHeight | Input 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. |
affineMatrix | 2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there's unexpected result, it could be due to different rotation convention. If that's the case, negate the angle before calculating transform matrix. |
The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
NOTE: data should be 128-bit aligned.
dst | Transformed output 8-bit image. NOTE: data should be 128-bit aligned. |
dstWidth | Dst image width. |
dstHeight | Dst 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. NOTE: should be a multiple of 8. |
dstBorder | Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,... where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2*dstHeight integers in size. If the dstBorder is set as NULL, then the border isn't processed. NOTE: data should be 128-bit aligned. |
interpolation | Specifies the interpolation method to use for sampling. |
FASTCV_API fcvStatus fcvTransformAffineClippedu8_v3 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
const float32_t *__restrict | affineMatrix, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
uint32_t *__restrict | dstBorder, | ||
fcvInterpolationType | interpolation, | ||
fcvBorderType | borderType, | ||
uint8_t | borderValue | ||
) |
Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.
ATTENTION: This function is a duplication of fcvTransformAffineClippedu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvTransformAffineClippedu8, fcvTransformAffineClippedu8_v3 will be removed, and the current signature for fcvTransformAffineClippedu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvTransformAffineClippedu8 when transitioning to 2.0.0.
src | Input 8-bit image. NOTE: data should be 128-bit aligned. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Input image width. The number of pixels in a row. |
srcHeight | Input 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. |
affineMatrix | 2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering: a11, a12, a13, a21, a22, a23 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there's unexpected result, it could be due to different rotation convention. If that's the case, negate the angle before calculating transform matrix. |
The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
NOTE: data should be 128-bit aligned.
dst | Transformed output 8-bit image. NOTE: data should be 128-bit aligned. |
dstWidth | Dst image width. |
dstHeight | Dst 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. NOTE: should be a multiple of 8. |
dstBorder | Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,... where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2*dstHeight integers in size. If the dstBorder is set as NULL, then the border isn't processed. NOTE: data should be 128-bit aligned. |
interpolation | Specifies the interpolation method to use for sampling. |
borderType | The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV_BORDER_UNDEFINED and FASTCV_BORDER_CONSTANT. |
borderValue | The user-specified constant pixel value, in case FASTCV_BORDER_CONSTANT is chosen for borderType. |
FASTCV_API int fcvTransformAffineu8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
const float *__restrict | position, | ||
const float *__restrict | affine, | ||
uint8_t *__restrict | patch, | ||
unsigned int | patchWidth, | ||
unsigned int | patchHeight | ||
) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvTransformAffineu8_v2(). In the 2.0.0 release, fcvTransformAffineu8_v2 will be renamed to fcvTransformAffineu8 and the signature of fcvTransformAffineu8 as it appears now, will be removed.
src | Input image. Size of buffer is srcWidth*srcHeight bytes. |
srcWidth | Image width. |
srcHeight | Image height. |
position[ | 2 ] Position in the image WARNING: must be 64-bit aligned. |
affine[ | 2 ][ 2 ] Transformation matrix. The matrix stored in affine is using row major ordering: a11, a12, a21, a22 where the matrix is: | a11, a12 | | a21, a22 | |
WARNING: should be 128-bit aligned.
patch | Transformed patch. |
patchWidth | Patch width. |
patchHeight | Patch height. |
FASTCV_API int fcvTransformAffineu8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
const float *__restrict | position, | ||
const float *__restrict | affine, | ||
uint8_t *__restrict | patch, | ||
unsigned int | patchWidth, | ||
unsigned int | patchHeight, | ||
unsigned int | patchStride | ||
) |
Warps the patch centered at nPos in the input image using the affine transform in nAffine.
ATTENTION: This function is a duplication of fcvTransformAffineu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvTransformAffineu8, fcvTransformAffineu8_v2 will be removed, and the current signature for fcvTransformAffineu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvTransformAffineu8 when transitioning to 2.0.0.
src | Input image. Size of buffer is srcStride*srcHeight bytes. |
srcWidth | Image width. |
srcHeight | Image height. |
srcStride | Stride of image (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. NOTE: if 0, srcStride is set as srcWidth. WARNING: must be at least as much as srcWidth if not 0. |
position[ | 2 ] Position in the image WARNING: must be 64-bit aligned. |
affine[ | 2 ][ 2 ] Transformation matrix. The matrix stored in affine is using row major ordering: a11, a12, a21, a22 where the matrix is: | a11, a12 | | a21, a22 | |
WARNING: should be 128-bit aligned.
patch | Transformed patch. |
patchWidth | Patch width. |
patchHeight | Patch height. |
patchStride | Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. NOTE: if 0, patchStride is set as patchWidth. WARNING: must be at least as much as patchWidth if not 0. |
FASTCV_API void fcvWarpPerspectiveu8 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
float *__restrict | projectionMatrix | ||
) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable.
ATTENTION: This function's signature will become OBSOLETE in a future release of this library (2.0.0). The new interface is specified in the function: fcvWarpPerspectiveu8_v2(). In the 2.0.0 release, fcvWarpPerspectiveu8_v2 will be renamed to fcvWarpPerspectiveu8 and the signature of fcvWarpPerspectiveu8 as it appears now, will be removed.
Warps an image taking into consideration the perspective scaling.
src | Input 8-bit image. Size of buffer is srcWidth*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Input image width. WARNING: should be multiple of 8. |
srcHeight | Input image height. WARNING: should be multiple of 8. |
dst | Warped output image. Size of buffer is dstWidth*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Dst image width. NOTE: data should be multiple of 8. |
dstHeight | Dst image height. NOTE: should be multiple of 8 |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
FASTCV_API void fcvWarpPerspectiveu8_v2 | ( | const uint8_t *__restrict | src, |
unsigned int | srcWidth, | ||
unsigned int | srcHeight, | ||
unsigned int | srcStride, | ||
uint8_t *__restrict | dst, | ||
unsigned int | dstWidth, | ||
unsigned int | dstHeight, | ||
unsigned int | dstStride, | ||
float *__restrict | projectionMatrix | ||
) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable.
ATTENTION: This function is a duplication of fcvWarpPerspectiveu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvWarpPerspectiveu8, fcvWarpPerspectiveu8_v2 will be removed, and the current signature for fcvWarpPerspectiveu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvWarpPerspectiveu8 when transitioning to 2.0.0.
Warps an image taking into consideration the perspective scaling.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Input image width. WARNING: should be multiple of 8. |
srcHeight | Input image height. WARNING: should be multiple of 8. |
srcStride | Input image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Warped output image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Dst image width. NOTE: data should be multiple of 8. |
dstHeight | Dst image height. NOTE: should be multiple of 8 |
dstStride | Output image stride (in bytes). NOTE: if 0, dstStride is set as dstWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
FASTCV_API fcvStatus fcvWarpPerspectiveu8_v3 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
float *__restrict | projectionMatrix, | ||
fcvInterpolationType | interpolation | ||
) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines.
ATTENTION: This function is a duplication of fcvWarpPerspectiveu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvWarpPerspectiveu8, fcvWarpPerspectiveu8_v3 will be removed, and the current signature for fcvWarpPerspectiveu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvWarpPerspectiveu8 when transitioning to 2.0.0.
Warps an image taking into consideration the perspective scaling.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Input image width. WARNING: should be multiple of 8. |
srcHeight | Input image height. WARNING: should be multiple of 8. |
srcStride | Input image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Warped output image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Dst image width. NOTE: data should be multiple of 8. |
dstHeight | Dst image height. NOTE: should be multiple of 8 |
dstStride | Output image stride (in bytes). NOTE: if 0, dstStride is set as dstWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
Specifies the interpolation method to be used.
FASTCV_API fcvStatus fcvWarpPerspectiveu8_v4 | ( | const uint8_t *__restrict | src, |
uint32_t | srcWidth, | ||
uint32_t | srcHeight, | ||
uint32_t | srcStride, | ||
uint8_t *__restrict | dst, | ||
uint32_t | dstWidth, | ||
uint32_t | dstHeight, | ||
uint32_t | dstStride, | ||
float *__restrict | projectionMatrix, | ||
fcvInterpolationType | interpolation, | ||
fcvBorderType | borderType, | ||
uint8_t | borderValue | ||
) |
Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines.
ATTENTION: This function is a duplication of fcvWarpPerspectiveu8() with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: fcvWarpPerspectiveu8, fcvWarpPerspectiveu8_v4 will be removed, and the current signature for fcvWarpPerspectiveu8 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to fcvWarpPerspectiveu8 when transitioning to 2.0.0.
Warps an image taking into consideration the perspective scaling.
src | Input 8-bit image. Size of buffer is srcStride*srcHeight bytes. WARNING: should be 128-bit aligned. |
srcWidth | Input image width. WARNING: should be multiple of 8. |
srcHeight | Input image height. WARNING: should be multiple of 8. |
srcStride | Input image stride (in bytes). NOTE: if 0, srcStride is set as srcWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as srcWidth if not 0. |
dst | Warped output image. Size of buffer is dstStride*dstHeight bytes. WARNING: should be 128-bit aligned. |
dstWidth | Dst image width. NOTE: data should be multiple of 8. |
dstHeight | Dst image height. NOTE: should be multiple of 8 |
dstStride | Output image stride (in bytes). NOTE: if 0, dstStride is set as dstWidth. WARNING: should be multiple of 8 (8 * 1-byte values), and at least as much as dstWidth if not 0. |
projectionMatrix | 3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering: a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is: | a11, a12, a13 | | a21, a22, a23 | | a31, a32, a33 | WARNING: should be 128-bit aligned. |
Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.
Specifies the interpolation method to be used.
borderType | The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV_BORDER_UNDEFINED and FASTCV_BORDER_CONSTANT. |
borderValue | The user-specified constant pixel value, in case FASTCV_BORDER_CONSTANT is chosen for borderType. |