Performs affine warp transformation from input image (8-bit) to output image (8-bit) using bilinear interpolation. If the input pixel mapping is out of bounds from the input image, then the border_constant_value is placed in the input value cooresponding to the out of bounds input.
- Method:
- The affine warp kernel is computed by using the following equation:
x0 = x * warpMatrix[0] + y * warpMatrix[2] + warpMatrix[4];
y0 = x * warpMatrix[1] + y * warpMatrix[3] + warpMatrix[5];
dst(x,y) = BilinearInterpolate(src(x0, y0))
- Parameters
-
[in] | src[] | Pointer to array containing first input image (UQ8.0) |
[in] | src_addr[] | Pointer to structure containing dimensional information of src |
[out] | dst[] | Pointer to array containing output image (UQ8.0) |
[in] | dst_addr[] | Pointer to structure containing dimensional information of dst |
[in] | warpMatrix[] | Pointer to array containing the affine coefficients (F32) |
[in] | border_constant_value | Parameter indicating out of bounds value (UQ8.0) |
[in] | srcOffsetX | Parameter indicating x offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | srcOffsetY | Parameter indicating y offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | dstOffsetX | Parameter indicating x offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |
[in] | dstOffsetY | Parameter indicating y offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |
- Assumptions:
- I/O buffer pointers are assumed to be not aliased.
- If a user wants to divide processing of the image into smaller blocks, then it can use the dstOffsetX and dstOffsetY to indicate the starting coordinate of the output block relative to the start of the full output image, and srcOffsetX and srcOffsetY to indicate the starting coordinate of the input block relative to the start of the full input image.
- When breaking input image processing into blocks, be sure to fetch enough overlap pixels from the input for interior edges for the warp, or else the function may put a false border within the block edge of of the output image.