Ocean
Ocean::CV::FrameInterpolatorBilinear Class Reference

This class implements bilinear frame interpolator functions. More...

Data Structures

class  Comfort
 The following comfort class provides comfortable functions simplifying prototyping applications but also increasing binary size of the resulting applications. More...
 
class  SpecialCases
 This class implements highly optimized interpolation functions with fixed properties. More...
 

Public Types

typedef LookupCorner2< Vector2LookupTable
 Definition of a lookup table for 2D vectors. More...
 

Static Public Member Functions

template<typename T , unsigned int tChannels>
static void resize (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Resizes a given frame with (almost) arbitrary data type (e.g., float, double, int) by using a bilinear interpolation. More...
 
template<typename T , unsigned int tChannels>
static void scale (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Rescales a given frame with arbitrary data type (e.g., float, double, int) by using a bilinear interpolation with user-defined scaling factors. More...
 
template<unsigned int tChannels>
static void rotate8BitPerChannel (const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const Scalar horizontalAnchorPosition, const Scalar verticalAnchorPosition, const Scalar angle, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr, const uint8_t *borderColor=nullptr)
 Rotates a given frame by a bilinear interpolation. More...
 
template<unsigned int tChannels>
static void affine8BitPerChannel (const uint8_t *source, const unsigned int sourceWidth, const unsigned int sourceHeight, const SquareMatrix3 &source_A_target, const uint8_t *borderColor, uint8_t *target, const PixelPositionI &targetOrigin, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Apply an affine transforms to a N-channel, 8-bit frame The target frame must have the same pixel format and pixel origin as the source frame, however the dimension (and position) of the target frame can be arbitrary. More...
 
template<typename T , unsigned int tChannels>
static void homography (const T *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 &input_H_output, const T *borderColor, T *output, const PixelPositionI &outputOrigin, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, Worker *worker=nullptr)
 Transforms a input frame with (almost) arbitrary pixel format into an output frame by application of a homography. More...
 
template<unsigned int tChannels>
static void homographies8BitPerChannel (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 homographies[4], const uint8_t *borderColor, uint8_t *output, const Vector2 &outputQuadrantCenter, const PixelPositionI &outputOrigin, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, Worker *worker=nullptr)
 Transforms a given 8 bit per channel input frame into an output frame by application of four homographies. More...
 
template<unsigned int tChannels>
static void homographyMask8BitPerChannel (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 &input_H_output, uint8_t *output, uint8_t *outputMask, const PixelPositionI &outputOrigin, const unsigned int outputWidth, const unsigned int outputHeight, const uint8_t maskValue, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, Worker *worker=nullptr)
 Transforms a given 8 bit per channel input frame into an output frame by application of a homography. More...
 
template<unsigned int tChannels>
static void homographiesMask8BitPerChannel (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 homographies[4], uint8_t *output, uint8_t *outputMask, const Vector2 &outputQuadrantCenter, const PixelPositionI &outputOrigin, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, Worker *worker=nullptr, const uint8_t maskValue=0xFF)
 Transforms a given 8 bit per channel input frame into an output frame by application of four homographies. More...
 
template<unsigned int tChannels>
static void homographyWithCamera8BitPerChannel (const PinholeCamera &inputCamera, const PinholeCamera &outputCamera, const uint8_t *input, const SquareMatrix3 &homography, const bool useDistortionParameters, const uint8_t *borderColor, uint8_t *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, Worker *worker=nullptr)
 Transforms a given 8 bit per channel input frame into an output frame by application of a homography. More...
 
template<unsigned int tChannels>
static void homographyWithCameraMask8BitPerChannel (const PinholeCamera &inputCamera, const PinholeCamera &outputCamera, const uint8_t *input, const unsigned int inputPaddingElements, const SquareMatrix3 &homography, uint8_t *output, uint8_t *outputMask, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, Worker *worker=nullptr, const uint8_t maskValue=0xFF)
 Transforms a given 8 bit per channel input frame into an output frame by application of a homography. More...
 
template<typename T , unsigned int tChannels>
static void lookup (const T *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable &input_LT_output, const bool offset, const T *borderColor, T *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, Worker *worker=nullptr)
 Transforms a given input frame into an output frame by application of an interpolation lookup table. More...
 
template<unsigned int tChannels>
static void lookupMask8BitPerChannel (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable &input_LT_output, const bool offset, uint8_t *output, uint8_t *outputMask, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, Worker *worker=nullptr, const uint8_t maskValue=0xFF)
 Transforms a given input frame into an output frame by application of an interpolation lookup table. More...
 
template<typename T , unsigned int tChannels>
static void resampleCameraImage (const T *sourceFrame, const AnyCamera &sourceCamera, const SquareMatrix3 &source_R_target, const AnyCamera &targetCamera, T *targetFrame, const unsigned int sourceFramePaddingElements, const unsigned int targetFramePaddingElements, LookupCorner2< Vector2 > *source_OLT_target=nullptr, Worker *worker=nullptr, const unsigned int binSizeInPixel=8u, const T *borderColor=nullptr)
 Re-samples a camera image which has been captured with a camera profile as if the image would have been captured with a second camera profile. More...
 
template<unsigned int tChannels, PixelCenter tPixelCenter = PC_TOP_LEFT, typename TScalar = Scalar>
static void interpolatePixel8BitPerChannel (const uint8_t *frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const VectorT2< TScalar > &position, uint8_t *result)
 Determines the interpolated pixel values for a given pixel position in an 8 bit per channel frame. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels, PixelCenter tPixelCenter = PC_TOP_LEFT, typename TScalar = Scalar, typename TIntermediate = TScalar>
static void interpolatePixel (const TSource *frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const VectorT2< TScalar > &position, TTarget *result, const TIntermediate &resultBias=TIntermediate(0))
 Determines the interpolated pixel values for a given pixel position in a frame with arbitrary data type. More...
 
template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
static void interpolate1PixelFullAlphaBorder8BitPerChannel (const uint8_t *frame, const unsigned int width, const unsigned int height, const Vector2 &position, uint8_t *result, const unsigned int framePaddingElements)
 Determines the interpolated pixel values for a given pixel position in an 8 bit per channel frame with alpha channel. More...
 
static Scalar patchIntensitySum1Channel (const uint32_t *linedIntegralFrame, const unsigned int frameWidth, const unsigned int frameHeight, const unsigned int lineIntegralFramePaddingElements, const Vector2 &center, const CV::PixelCenter pixelCenter, const unsigned int patchWidth, const unsigned int patchHeight)
 Interpolate the sum of intensity values of an image patch in a frame, while the frame is provided as lined integral frame. More...
 
static bool coversHomographyInputFrame (const unsigned int inputWidth, const unsigned int inputHeight, const unsigned int outputWidth, const unsigned int outputHeight, const SquareMatrix3 &input_H_output, const int outputOriginX=0, const int outputOriginY=0)
 Checks whether the application of a given homography for a specified input frame and output frame covers the entire image information (which is necessary for the bilinear interpolation) or whether the homography relies on missing image information. More...
 

Static Private Member Functions

template<unsigned int tChannels>
static void homography8BitPerChannel (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 &input_H_output, const uint8_t *borderColor, uint8_t *output, const PixelPositionI &outputOrigin, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, Worker *worker=nullptr)
 Transforms a given 8 bit per channel input frame into an output frame by application of a homography. More...
 
template<unsigned int tChannels>
static void scale8BitPerChannel (const uint8_t *source, uint8_t *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Rescales a given frame with 8 bit per data channel by using a bilinear interpolation with user-defined scaling factors. More...
 
template<unsigned int tChannels>
static void scale8BitPerChannelSubset (const uint8_t *source, uint8_t *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Resizes a subset of a given frame with 8 bit per channel by a bilinear interpolation. More...
 
static void interpolateRowHorizontal8BitPerChannel7BitPrecision (const uint8_t *extendedSourceRow, uint8_t *targetRow, const unsigned int targetWidth, const unsigned int channels, const unsigned int *interpolationLocations, const uint8_t *interpolationFactors)
 Applies a (horizontal) linear interpolation for one row with 8 bit per channel. More...
 
template<typename T >
static void interpolateRowVertical (const T *sourceRowTop, const T *sourceRowBottom, T *targetRow, const unsigned int elements, const float factorBottom)
 Applies a (vertical) linear interpolation between two rows with arbitrary data types. More...
 
template<typename T , unsigned int tChannels>
static void interpolateRowHorizontal (const T *extendedSourceRow, T *targetRow, const unsigned int targetWidth, const unsigned int channels, const unsigned int *interpolationLocations, const float *interpolationFactorsRight)
 Applies a (horizontal) linear interpolation for one row with arbitrary data type. More...
 
static void interpolateRowVertical8BitPerChannel7BitPrecisionNEON (const uint8_t *sourceRowTop, const uint8_t *sourceRowBottom, uint8_t *targetRow, const unsigned int elements, const unsigned int factorBottom)
 Applies a (vertical) linear interpolation between two rows with 8 bit per channel. More...
 
template<typename T >
static void interpolateRowVerticalNEON (const T *sourceRowTop, const T *sourceRowBottom, T *targetRow, const unsigned int elements, const float factorBottom)
 Applies a (vertical) linear interpolation between two rows with arbitrary data types. More...
 
template<unsigned int tChannels>
static void interpolateRowHorizontal8BitPerChannel7BitPrecisionNEON (const uint8_t *extendedSourceRow, uint8_t *targetRow, const unsigned int targetWidth, const unsigned int channels, const unsigned int *interpolationLocations, const uint8_t *interpolationFactors)
 Applies a (horizontal) linear interpolation for one row with 8 bit per channel. More...
 
template<typename T , unsigned int tChannels>
static void interpolateRowHorizontalNEON (const T *extendedSourceRow, T *targetRow, const unsigned int targetWidth, const unsigned int channels, const unsigned int *interpolationLocations, const float *interpolationFactorsRight)
 Applies a (horizontal) linear interpolation for one row with arbitrary data type. More...
 
static void scale8BitPerChannelSubset7BitPrecisionNEON (const uint8_t *source, uint8_t *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int channels, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Rescales a subset of a given frame with 8 bit per channel by a bilinear interpolation. More...
 
template<typename T , typename TScale , unsigned int tChannels>
static void scaleSubset (const T *source, T *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Resizes a subset of a given frame with arbitrary data type by a bilinear interpolation. More...
 
template<unsigned int tChannels>
static void rotate8BitPerChannelSubset (const uint8_t *source, uint8_t *target, const unsigned int width, const unsigned int height, const Scalar horizontalAnchorPosition, const Scalar verticalAnchorPosition, const Scalar angle, const uint8_t *borderColor, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 Rotates a subset of a given frame by a bilinear interpolation. More...
 
template<unsigned int tChannels>
static void affine8BitPerChannelSubset (const uint8_t *source, const unsigned int sourceWidth, const unsigned int sourceHeight, const SquareMatrix3 *source_A_target, const uint8_t *borderColor, uint8_t *target, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int firstTargetRow, const unsigned int numberTargetRows, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Subset function to apply an affine transform to an N-channel, 8-bit unsigned image. More...
 
template<unsigned int tChannels>
static void homography8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *input_H_output, const uint8_t *borderColor, uint8_t *output, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<typename T , unsigned int tChannels>
static void homographySubset (const T *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *input_H_output, const T *borderColor, T *output, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms a frame with (almost) arbitrary pixel format using the given homography. More...
 
template<unsigned int tChannels>
static void affine8BitPerChannelSSESubset (const uint8_t *source, const unsigned int sourceWidth, const unsigned int sourceHeight, const SquareMatrix3 *source_A_target, const uint8_t *borderColor, uint8_t *target, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int firstTargetRow, const unsigned int numberTargetRows, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Subset function to apply an affine transform to an N-channel, 8-bit unsigned image (using SSE). More...
 
template<unsigned int tChannels>
static void homography8BitPerChannelSSESubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *input_H_output, const uint8_t *borderColor, uint8_t *output, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelSSE (const uint8_t *source, const unsigned int offsetsTopLeft[4], const unsigned int offsetsTopRight[4], const unsigned int offsetsBottomLeft[4], const unsigned int offsetsBottomRight[4], const unsigned int validPixels[4], const typename DataType< uint8_t, tChannels >::Type &borderColor, const __m128i &m128_factorsRight, const __m128i &m128_factorsBottom, typename DataType< uint8_t, tChannels >::Type *targetPositionPixels)
 Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels. More...
 
template<unsigned int tChannels>
static OCEAN_FORCE_INLINE __m128i interpolate4Pixels8BitPerChannelSSE (const __m128i &m128_sourcesTopLeft, const __m128i &m128_sourcesTopRight, const __m128i &m128_sourcesBottomLeft, const __m128i &m128_sourcesBottomRight, const __m128i &m128_factorsTopLeft, const __m128i &m128_factorsTopRight, const __m128i &m128_factorsBottomLeft, const __m128i &m128_factorsBottomRight)
 Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels. More...
 
template<unsigned int tChannels>
static void affine8BitPerChannelNEONSubset (const uint8_t *source, const unsigned int sourceWidth, const unsigned int sourceHeight, const SquareMatrix3 *source_A_target, const uint8_t *borderColor, uint8_t *target, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int firstTargetRow, const unsigned int numberTargetRows, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements)
 Subset function to apply an affine transform to an N-channel, 8-bit unsigned image (using NEON). More...
 
template<unsigned int tChannels>
static void homography8BitPerChannelNEONSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *input_H_output, const uint8_t *borderColor, uint8_t *output, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelNEON (const uint8_t *source, const unsigned int offsetsTopLeftElements[4], const unsigned int offsetsTopRightElements[4], const unsigned int offsetsBottomLeftElements[4], const unsigned int offsetsBottomRightElements[4], const unsigned int validPixels[4], const typename DataType< uint8_t, tChannels >::Type &borderColor, const uint32x4_t &m128_factorsRight, const uint32x4_t &m128_factorsBottom, typename DataType< uint8_t, tChannels >::Type *targetPositionPixels)
 Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels. More...
 
static OCEAN_FORCE_INLINE void interpolate8Pixels1Channel8BitNEON (const uint8x8_t &topLeft_u_8x8, const uint8x8_t &topRight_u_8x8, const uint8x8_t &bottomLeft_u_8x8, const uint8x8_t &bottomRight_u_8x8, const uint8x16_t &factorsRight_factorsBottom_128_u_8x16, uint8_t *targetPositionPixels)
 Interpolates 8 independent pixels concurrently of a 1 channel frame, the source pixel locations must be known already (top-left, top-right, bottom-left, and bottom-right), further the interpolation factors must be known already. More...
 
template<unsigned int tChannels>
static void homographies8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *homographies, const uint8_t *borderColor, uint8_t *output, const Scalar outputQuadrantCenterX, const Scalar outputQuadrantCenterY, const int outputOriginX, const int outputOriginY, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homographies. More...
 
template<unsigned int tChannels>
static void homographyMask8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *input_H_output, uint8_t *output, uint8_t *outputMask, const uint8_t maskValue, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static void homographiesMask8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const SquareMatrix3 *homographies, uint8_t *output, uint8_t *outputMask, const uint8_t maskValue, const Scalar outputQuadrantCenterX, const Scalar outputQuadrantCenterY, const int outputOriginX, const int outputOriginY, const unsigned int outputWidth, const unsigned int outputHeight, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, const unsigned int firstOutputRow, const unsigned int numberOutputRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static void homographyWithCamera8BitPerChannelSubset (const PinholeCamera *inputCamera, const PinholeCamera *outputCamera, const PinholeCamera::DistortionLookup *outputCameraDistortionLookup, const uint8_t *input, const SquareMatrix3 *normalizedHomography, const bool useDistortionParameters, const uint8_t *borderColor, uint8_t *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static void homographyWithCameraMask8BitPerChannelSubset (const PinholeCamera *inputCamera, const PinholeCamera *outputCamera, const PinholeCamera::DistortionLookup *outputCameraDistortionLookup, const uint8_t *input, const unsigned int inputPaddingElements, const SquareMatrix3 *normalizedHomography, uint8_t *output, uint8_t *outputMask, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, const uint8_t maskValue, const unsigned int firstRow, const unsigned int numberRows)
 Transforms an 8 bit per channel frame using the given homography. More...
 
template<unsigned int tChannels>
static void lookup8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable *input_LT_output, const bool offset, const uint8_t *borderColor, uint8_t *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Transforms a subset of a given input frame with uint8_t as element type into an output frame by application of an interpolation lookup table. More...
 
template<typename T , unsigned int tChannels>
static void lookupSubset (const T *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable *input_LT_output, const bool offset, const T *borderColor, T *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Transforms a subset of a given input frame with arbitrary element type into an output frame by application of an interpolation lookup table. More...
 
template<unsigned int tChannels>
static void lookup8BitPerChannelSubsetNEON (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable *input_LT_output, const bool offset, const uint8_t *borderColor, uint8_t *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Transforms a subset of a given input frame into an output frame by application of an interpolation lookup table and uses NEON instructions. More...
 
template<unsigned int tChannels>
static void lookupMask8BitPerChannelSubset (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable *input_LT_output, const bool offset, uint8_t *output, uint8_t *outputMask, const uint8_t maskValue, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int outputMaskPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Transforms a given input frame into an output frame by application of an interpolation lookup table. More...
 
template<>
OCEAN_FORCE_INLINE __m128i interpolate4Pixels8BitPerChannelSSE (const __m128i &sourcesTopLeft, const __m128i &sourcesTopRight, const __m128i &sourcesBottomLeft, const __m128i &sourcesBottomRight, const __m128i &factorsTopLeft, const __m128i &factorsTopRight, const __m128i &factorsBottomLeft, const __m128i &factorsBottomRight)
 
template<>
OCEAN_FORCE_INLINE __m128i interpolate4Pixels8BitPerChannelSSE (const __m128i &sourcesTopLeft, const __m128i &sourcesTopRight, const __m128i &sourcesBottomLeft, const __m128i &sourcesBottomRight, const __m128i &factorsTopLeft, const __m128i &factorsTopRight, const __m128i &factorsBottomLeft, const __m128i &factorsBottomRight)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelSSE (const uint8_t *source, const unsigned int offsetsTopLeft[4], const unsigned int offsetsTopRight[4], const unsigned int offsetsBottomLeft[4], const unsigned int offsetsBottomRight[4], const unsigned int validPixels[4], const DataType< uint8_t, 1u >::Type &borderColor, const __m128i &m128_factorsRight, const __m128i &m128_factorsBottom, typename DataType< uint8_t, 1u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelSSE (const uint8_t *source, const unsigned int offsetsTopLeft[4], const unsigned int offsetsTopRight[4], const unsigned int offsetsBottomLeft[4], const unsigned int offsetsBottomRight[4], const unsigned int validPixels[4], const DataType< uint8_t, 3u >::Type &borderColor, const __m128i &m128_factorsRight, const __m128i &m128_factorsBottom, typename DataType< uint8_t, 3u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelSSE (const uint8_t *source, const unsigned int offsetsTopLeft[4], const unsigned int offsetsTopRight[4], const unsigned int offsetsBottomLeft[4], const unsigned int offsetsBottomRight[4], const unsigned int validPixels[4], const DataType< uint8_t, 4u >::Type &borderColor, const __m128i &m128_factorsRight, const __m128i &m128_factorsBottom, typename DataType< uint8_t, 4u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelNEON (const uint8_t *source, const unsigned int offsetsTopLeftElements[4], const unsigned int offsetsTopRightElements[4], const unsigned int offsetsBottomLeftElements[4], const unsigned int offsetsBottomRightElements[4], const unsigned int validPixels[4], const DataType< uint8_t, 1u >::Type &borderColor, const uint32x4_t &m128_factorsRight, const uint32x4_t &m128_factorsBottom, typename DataType< uint8_t, 1u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelNEON (const uint8_t *source, const unsigned int offsetsTopLeftElements[4], const unsigned int offsetsTopRightElements[4], const unsigned int offsetsBottomLeftElements[4], const unsigned int offsetsBottomRightElements[4], const unsigned int validPixels[4], const DataType< uint8_t, 2u >::Type &borderColor, const uint32x4_t &m128_factorsRight, const uint32x4_t &m128_factorsBottom, typename DataType< uint8_t, 2u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelNEON (const uint8_t *source, const unsigned int offsetsTopLeftElements[4], const unsigned int offsetsTopRightElements[4], const unsigned int offsetsBottomLeftElements[4], const unsigned int offsetsBottomRightElements[4], const unsigned int validPixels[4], const DataType< uint8_t, 3u >::Type &borderColor, const uint32x4_t &m128_factorsRight, const uint32x4_t &m128_factorsBottom, typename DataType< uint8_t, 3u >::Type *targetPositionPixels)
 
template<>
OCEAN_FORCE_INLINE void interpolate4Pixels8BitPerChannelNEON (const uint8_t *source, const unsigned int offsetsTopLeftElements[4], const unsigned int offsetsTopRightElements[4], const unsigned int offsetsBottomLeftElements[4], const unsigned int offsetsBottomRightElements[4], const unsigned int validPixels[4], const DataType< uint8_t, 4u >::Type &borderColor, const uint32x4_t &m128_factorsRight, const uint32x4_t &m128_factorsBottom, typename DataType< uint8_t, 4u >::Type *targetPositionPixels)
 
template<>
void lookup8BitPerChannelSubsetNEON (const uint8_t *input, const unsigned int inputWidth, const unsigned int inputHeight, const LookupTable *input_LT_output, const bool offset, const uint8_t *borderColor, uint8_t *output, const unsigned int inputPaddingElements, const unsigned int outputPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 
template<>
void interpolateRowVerticalNEON (const float *sourceRowTop, const float *sourceRowBottom, float *targetRow, const unsigned int elements, const float factorBottom)
 
template<>
void interpolateRowHorizontalNEON (const float *extendedSourceRow, float *targetRow, const unsigned int targetWidth, const unsigned int channels, const unsigned int *interpolationLocations, const float *interpolationFactorsRight)
 
template<>
void scaleSubset (const float *source, float *target, const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const double sourceX_s_targetX, const double sourceY_s_targetY, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstTargetRow, const unsigned int numberTargetRows)
 

Detailed Description

This class implements bilinear frame interpolator functions.

Member Typedef Documentation

◆ LookupTable

Definition of a lookup table for 2D vectors.

Member Function Documentation

◆ affine8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::affine8BitPerChannel ( const uint8_t *  source,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const SquareMatrix3 source_A_target,
const uint8_t *  borderColor,
uint8_t *  target,
const PixelPositionI targetOrigin,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Apply an affine transforms to a N-channel, 8-bit frame The target frame must have the same pixel format and pixel origin as the source frame, however the dimension (and position) of the target frame can be arbitrary.


This function allows the creation of an target frame fully covering the source frame (if the position and dimension of the target frame covers the transformation of the affine transformation).
The 'targetOrigin' parameter simply applies an additional translation onto the provided affine transformation i.e., affine * create_translation_matrix3x3(targetOrigin.x(), targetOrigin.y()). Please note that here the affine transformation is specified as a 3-by-3 matrix (in contrast to the more commonly used 2-by-3 matrix) and should take of the form:

a c e
b d f
0 0 1

However, this function disregards the last row completely and only uses the top two rows, i.e., the elements a through f.

Parameters
sourceInput frame that will be transformed, must be valid
sourceWidthWidth of both images in pixel, with range [1, infinity)
sourceHeightHeight of both images pixel, with range [1, infinity)
source_A_targetAffine transformation, such that: sourcePoint = source_A_target * targetPoint
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
targetThe target frame using the given affine transform, must be valid
targetOriginThe origin of the target frame defining the global position of the target frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
targetWidthThe width of the target image in pixel, with range [1, infinity)
targetHeightThe height of the target image in pixel, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source frame row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
tChannelsNumber of channels of the frame
See also
homographyMask8BitPerChannel(), homographyWithCamera8BitPerChannel(), homography().

◆ affine8BitPerChannelNEONSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::affine8BitPerChannelNEONSubset ( const uint8_t *  source,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const SquareMatrix3 source_A_target,
const uint8_t *  borderColor,
uint8_t *  target,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements 
)
inlinestaticprivate

Subset function to apply an affine transform to an N-channel, 8-bit unsigned image (using NEON).

This function applies NEON instructions.
This one has the property: sourcePoint = source_A_target * targetPoint Beware: The target width 'targetWidth' must be >= 4, use affine8BitPerChannelSubset for small target frames Please note that here the affine transformation is specified as a 3-by-3 matrix (in contrast to the more commonly used 2-by-3 matrix) and should take of the form:

a c e
b d f
0 0 1

However, this function disregards the last row completely and only uses the top two rows, i.e., the elements a through f.

Parameters
sourceThe source frame that will be transformed
sourceWidthWidth of both source images in pixel, with range [1, infinity)
sourceHeightHeight of both source images pixel, with range [1, infinity)
source_A_targetAffine transform used to transform the given source frame.
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
targetThe target frame using the given affine transform
targetWidthThe width of the target image in pixel, with range [4, infinity)
targetHeightThe height of the target image in pixel, with range [1, infinity)
firstTargetRowThe first target row to be handled
numberTargetRowsNumber of target rows to be handled
sourcePaddingElementsThe number of padding elements at the end of each source frame, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target frame, in elements, with range [0, infinity)
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)
See also
homography8BitPerChannelSubset().

◆ affine8BitPerChannelSSESubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::affine8BitPerChannelSSESubset ( const uint8_t *  source,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const SquareMatrix3 source_A_target,
const uint8_t *  borderColor,
uint8_t *  target,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements 
)
inlinestaticprivate

Subset function to apply an affine transform to an N-channel, 8-bit unsigned image (using SSE).

This function applies SSE instructions.
Beware: The target width 'targetWidth' must be >= 4, use affine8BitPerChannelSubset for small target frames This function has the property: sourcePoint = source_A_target * targetPoint Please note that here the affine transformation is specified as a 3-by-3 matrix (in contrast to the more commonly used 2-by-3 matrix) and should take of the form:

a c e
b d f
0 0 1

However, this function disregards the last row completely and only uses the top two rows, i.e., the elements a through f.

Parameters
sourceInput frame that will be transformed
sourceWidthWidth of both source images in pixel, with range [1, infinity)
sourceHeightHeight of both source images pixel, with range [1, infinity)
source_A_targetAffine transformation which is applied to source frame.
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
targetThe target frame where the result of the transformation will be stored
targetWidthThe width of the target image in pixel, with range [4, infinity)
targetHeightThe height of the target image in pixel, with range [1, infinity)
firstTargetRowThe first target row to be handled
numberTargetRowsNumber of target rows to be handled
sourcePaddingElementsThe number of padding elements at the end of each source frame, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target frame, in elements, with range [0, infinity)
Template Parameters
tChannelsNumber of frame channels
See also
affine8BitPerChannelSubset(), affine8BitPerChannelSubsetNEON().

◆ affine8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::affine8BitPerChannelSubset ( const uint8_t *  source,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const SquareMatrix3 source_A_target,
const uint8_t *  borderColor,
uint8_t *  target,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements 
)
inlinestaticprivate

Subset function to apply an affine transform to an N-channel, 8-bit unsigned image.

The affine transform must be provided in the following form: sourcePoint = source_A_target * targetPoint This function does not apply SIMD instructions and can be used for any frame dimensions. Please note that here the affine transformation is specified as a 3-by-3 matrix (in contrast to the more commonly used 2-by-3 matrix) and should take of the form:

a c e
b d f
0 0 1

However, this function disregards the last row completely and only uses the top two rows, i.e., the elements a through f.

Parameters
sourceInput frame that will be transformed
sourceWidthWidth of both source images in pixel, with range [1, infinity)
sourceHeightHeight of both source images pixel, with range [1, infinity)
source_A_targetAffine transformation which is applied to the source frame.
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
targetOutput frame using the given affine transform
targetWidthThe width of the target image in pixel, with range [1, infinity)
targetHeightThe height of the target image in pixel, with range [1, infinity)
firstTargetRowThe first target row to be handled
numberTargetRowsNumber of target rows to be handled
sourcePaddingElementsThe number of padding elements at the end of each source frame, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target frame, in elements, with range [0, infinity)
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)
See also
affine8BitPerChannelSSESubset(), affine8BitPerChannelNEONSubset()

◆ coversHomographyInputFrame()

static bool Ocean::CV::FrameInterpolatorBilinear::coversHomographyInputFrame ( const unsigned int  inputWidth,
const unsigned int  inputHeight,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const SquareMatrix3 input_H_output,
const int  outputOriginX = 0,
const int  outputOriginY = 0 
)
static

Checks whether the application of a given homography for a specified input frame and output frame covers the entire image information (which is necessary for the bilinear interpolation) or whether the homography relies on missing image information.

Parameters
inputWidthThe width of the input frame in pixel, with range [1, infinity)
inputHeightThe height of the input frame in pixel, with range [1, infinity)
outputWidthThe width of the output frame in pixel, with range [1, infinity)
outputHeightThe height of the output frame in pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
outputOriginXThe horizontal origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)
outputOriginYThe vertical origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)
Returns
True, if the homography covers the entire input image information (if all output pixels will receive valid data from the input frame); False, otherwise

◆ homographies8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographies8BitPerChannel ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3  homographies[4],
const uint8_t *  borderColor,
uint8_t *  output,
const Vector2 outputQuadrantCenter,
const PixelPositionI outputOrigin,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Transforms a given 8 bit per channel input frame into an output frame by application of four homographies.

For each quadrant of the output frame an individual homography is applied while the final result is interpolated between the four homographies.
The quadrant order of the homographies is as follows: top left, top right, bottom left, bottom right.
The output frame must have the same pixel format and pixel origin as the input frame, however the dimension (and position) of the output frame can be arbitrary.
This function allows the creation of an output frame fully covering the input frame (if the position and dimension of the output frame covers the transformation of the homography.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both images in pixel, with range [1, infinity)
inputHeightHeight of both images pixel, with range [1, infinity)
homographiesFour homographies used to transform the given input frame, transforming points defined in the output frame into points defined in the input frame
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
outputQuadrantCenterThe center position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputWidth)x[0, outputHeight)
outputOriginThe origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
tChannelsNumber of channels of the frame
See also
homographyMask8BitPerChannel(), homographyWithCamera8BitPerChannel().

◆ homographies8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographies8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 homographies,
const uint8_t *  borderColor,
uint8_t *  output,
const Scalar  outputQuadrantCenterX,
const Scalar  outputQuadrantCenterY,
const int  outputOriginX,
const int  outputOriginY,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homographies.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
homographiesHomographies used to transform the given input frame
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
outputQuadrantCenterXThe horizontal position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputWidth)
outputQuadrantCenterYThe vertical position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputHeight)
outputOriginXThe horizontal coordinate of the output frame's origin
outputOriginYThe vertical coordinate of the output frame's origin
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled
numberOutputRowsNumber of output rows to be handled
Template Parameters
tChannelsNumber of frame channels

◆ homographiesMask8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographiesMask8BitPerChannel ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3  homographies[4],
uint8_t *  output,
uint8_t *  outputMask,
const Vector2 outputQuadrantCenter,
const PixelPositionI outputOrigin,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
Worker worker = nullptr,
const uint8_t  maskValue = 0xFF 
)
inlinestatic

Transforms a given 8 bit per channel input frame into an output frame by application of four homographies.

For each quadrant of the output frame an individual homography is applied while the final result is interpolated between the four homographies.
The quadrant order of the homographies is as follows: top left, top right, bottom left, bottom right.
The output frame must have the same pixel format and pixel origin as the input frame, however the dimension (and position) of the output frame can be arbitrary.
This function allows the creation of an output frame fully covering the input frame (if the position and dimension of the output frame covers the transformation of the homography.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both images in pixel, with range [1, infinity)
inputHeightHeight of both images pixel, with range [1, infinity)
homographiesFour homographies used to transform the given input frame, transforming points defined in the output frame into points defined in the input frame
outputThe output frame using the given homography
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
outputQuadrantCenterThe center position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputWidth)x[0, outputHeight)
outputOriginThe origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each row of the output mask, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
Template Parameters
tChannelsNumber of channels of the frame
See also
homography(), homographyWithCamera8BitPerChannel().

◆ homographiesMask8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographiesMask8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 homographies,
uint8_t *  output,
uint8_t *  outputMask,
const uint8_t  maskValue,
const Scalar  outputQuadrantCenterX,
const Scalar  outputQuadrantCenterY,
const int  outputOriginX,
const int  outputOriginY,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homography.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
homographiesHomographies used to transform the given input frame
outputThe output frame resulting by application of the given homography
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
outputQuadrantCenterXThe horizontal position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputWidth)
outputQuadrantCenterYThe vertical position of the four quadrants in the output frame (the local center not respecting the optional outputOrigin parameter), with range [0, outputHeight)
outputOriginXThe horizontal coordinate of the output frame's origin
outputOriginYThe vertical coordinate of the output frame's origin
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each row of the output mask, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled
numberOutputRowsNumber of output rows to be handled
Template Parameters
tChannelsNumber of frame channels

◆ homography()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homography ( const T *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const T *  borderColor,
T *  output,
const PixelPositionI outputOrigin,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Transforms a input frame with (almost) arbitrary pixel format into an output frame by application of a homography.

The output frame must have the same pixel format and pixel origin as the input frame, however the dimension (and position) of the output frame can be arbitrary.
This function allows the creation of an output frame fully covering the input frame (if the position and dimension of the output frame covers the transformation of the homography.
The 'outputOrigin' parameter simply applies an additional translation onto the provided homography i.e., homography * create_translation_matrix3x3(outputOrigin.x(), outputOrigin.y()).

Parameters
inputThe input frame that will be transformed, must be valid
inputWidthWidth of both images in pixel, with range [1, infinity)
inputHeightHeight of both images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography, must be valid
outputOriginThe origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
TData type of each pixel channel, e.g., float, double, int
tChannelsNumber of channels of the frame, with range [1, infinity)
See also
homographyMask8BitPerChannel(), homographyWithCamera8BitPerChannel().

◆ homography8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homography8BitPerChannel ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const uint8_t *  borderColor,
uint8_t *  output,
const PixelPositionI outputOrigin,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
Worker worker = nullptr 
)
inlinestaticprivate

Transforms a given 8 bit per channel input frame into an output frame by application of a homography.

The output frame must have the same pixel format and pixel origin as the input frame, however the dimension (and position) of the output frame can be arbitrary.
This function allows the creation of an output frame fully covering the input frame (if the position and dimension of the output frame covers the transformation of the homography).
The 'outputOrigin' parameter simply applies an additional translation onto the provided homography i.e., homography * create_translation_matrix3x3(outputOrigin.x(), outputOrigin.y()).

Parameters
inputThe input frame that will be transformed, must be valid
inputWidthWidth of both images in pixel, with range [1, infinity)
inputHeightHeight of both images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography, must be valid
outputOriginThe origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
tChannelsNumber of channels of the frame
See also
homographyMask8BitPerChannel(), homographyWithCamera8BitPerChannel(), homography().

◆ homography8BitPerChannelNEONSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homography8BitPerChannelNEONSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homography.

This function applies NEON instructions.
Beware: The output width 'outputWidth' must be >= 4, use homography8BitPerChannelSubset for small output frames.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
outputWidthThe width of the output image in pixel, with range [4, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled, with range [0, outputHeight - 1]
numberOutputRowsNumber of output rows to be handled, with range [1, outputHeight - firstOutputRow]
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)
See also
homography8BitPerChannelSubset().

◆ homography8BitPerChannelSSESubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homography8BitPerChannelSSESubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homography.

This function applies SSE instructions.
Beware: The output width 'outputWidth' must be >= 4, use homography8BitPerChannelSubset for small output frames

Parameters
inputThe input frame that will be transformed, must be valid
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography, must be valid
outputWidthThe width of the output image in pixel, with range [4, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled, with range [0, outputHeight - 1]
numberOutputRowsNumber of output rows to be handled, with range [1, outputHeight - firstOutputRow]
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)
See also
homography8BitPerChannelSubset().

◆ homography8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homography8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homography.

The homography must provide the following transformation: inputPoint = homography * outputPoint This function does not apply SIMD instructions and can be used for any frame dimensions.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled, with range [0, height - 1]
numberOutputRowsNumber of output rows to be handled, with range [1, height - firstOutputRow]
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)
See also
homography8BitPerChannelSSESubset(), homography8BitPerChannelNEONSubset()

◆ homographyMask8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyMask8BitPerChannel ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
uint8_t *  output,
uint8_t *  outputMask,
const PixelPositionI outputOrigin,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const uint8_t  maskValue,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Transforms a given 8 bit per channel input frame into an output frame by application of a homography.

The output frame must have the same pixel format and pixel origin as the input frame, however the dimension (and position) of the output frame can be arbitrary.
This function allows the creation of an output frame fully covering the input frame (if the position and dimension of the output frame covers the transformation of the homography.
The 'outputOrigin' parameter simply applies an additional translation onto the provided homography i.e., homography * create_translation_matrix3x3(outputOrigin.x(), outputOrigin.y()).

Parameters
inputThe input frame that will be transformed, must be valid
inputWidthWidth of both images in pixel, with range [1, infinity)
inputHeightHeight of both images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
outputThe output frame using the given homography, must be valid
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame, must be valid
outputOriginThe origin of the output frame defining the global position of the output frame's pixel coordinate (0, 0), with range (-infinity, infinity)x(-infinity, infinity)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of output mask input row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
tChannelsNumber of channels of the frame, with range [1, infinity)
See also
homography(), homographyWithCamera8BitPerChannel().

◆ homographyMask8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyMask8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
uint8_t *  output,
uint8_t *  outputMask,
const uint8_t  maskValue,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms an 8 bit per channel frame using the given homography.

Parameters
inputThe input frame that will be transformed, must be valid
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
outputThe output frame resulting by application of the given homography, must be valid
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of output mask input row, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled
numberOutputRowsNumber of output rows to be handled
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)

◆ homographySubset()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographySubset ( const T *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const SquareMatrix3 input_H_output,
const T *  borderColor,
T *  output,
const unsigned int  outputWidth,
const unsigned int  outputHeight,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstOutputRow,
const unsigned int  numberOutputRows 
)
inlinestaticprivate

Transforms a frame with (almost) arbitrary pixel format using the given homography.

This function does not apply SIMD instructions and can be used for any frame dimensions.

Parameters
inputThe input frame that will be transformed
inputWidthWidth of both input images in pixel, with range [1, infinity)
inputHeightHeight of both input images pixel, with range [1, infinity)
input_H_outputHomography used to transform the given input frame by following equation: inputPoint = input_H_output * outputPoint, must be valid
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
outputWidthThe width of the output image in pixel, with range [1, infinity)
outputHeightThe height of the output image in pixel, with range [1, infinity)
inputPaddingElementsThe number of padding elements at the end of each input frame row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output frame row, in elements, with range [0, infinity)
firstOutputRowThe first output row to be handled, with range [0, height - 1]
numberOutputRowsNumber of output rows to be handled, with range [1, height - firstOutputRow]
Template Parameters
TData type of each pixel channel, e.g., float, double, int
tChannelsNumber of frame channels, with range [1, infinity)
See also
homography8BitPerChannelSSESubset().

◆ homographyWithCamera8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyWithCamera8BitPerChannel ( const PinholeCamera inputCamera,
const PinholeCamera outputCamera,
const uint8_t *  input,
const SquareMatrix3 homography,
const bool  useDistortionParameters,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Transforms a given 8 bit per channel input frame into an output frame by application of a homography.

This function also uses a camera profile to improve the interpolation accuracy.
The given homography is transformed into a homography for normalized image coordinates.
Thus, also distortion parameters of the camera profile can be applied.

Parameters
inputCameraThe pinhole camera profile to be applied for the input frame
outputCameraThe pinhole camera profile to be applied for the output frame
inputThe input frame that will be transformed
homographyThe homography used to transform the given input frame by following equation: inputPoint = homography * outputPoint
useDistortionParametersTrue, to apply the distortion parameters of the camera profile
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame using the given homography
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
Template Parameters
tChannelsNumber of channels of the frame
See also
homography().

◆ homographyWithCamera8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyWithCamera8BitPerChannelSubset ( const PinholeCamera inputCamera,
const PinholeCamera outputCamera,
const PinholeCamera::DistortionLookup *  outputCameraDistortionLookup,
const uint8_t *  input,
const SquareMatrix3 normalizedHomography,
const bool  useDistortionParameters,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms an 8 bit per channel frame using the given homography.

Parameters
inputCameraThe pinhole camera profile to be applied for the input frame
outputCameraThe pinhole camera profile to be applied for the output frame
outputCameraDistortionLookupThe distortion lookup table of the of the output camera
inputThe input frame that will be transformed
normalizedHomographyThe homography used to transform the given input frame specified in normalized camera coordinates
useDistortionParametersTrue, to apply the distortion parameters of the camera profile
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputThe output frame resulting by application of the given homography
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
firstRowThe first row to be handled
numberRowsNumber of rows to be handled
Template Parameters
tChannelsNumber of frame channels

◆ homographyWithCameraMask8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyWithCameraMask8BitPerChannel ( const PinholeCamera inputCamera,
const PinholeCamera outputCamera,
const uint8_t *  input,
const unsigned int  inputPaddingElements,
const SquareMatrix3 homography,
uint8_t *  output,
uint8_t *  outputMask,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
Worker worker = nullptr,
const uint8_t  maskValue = 0xFF 
)
inlinestatic

Transforms a given 8 bit per channel input frame into an output frame by application of a homography.

Input frame pixels lying outside the frame will be masked in the resulting output mask frame.
This function also uses a camera profile to improve the interpolation accuracy.
The given homography is transformed into a homography for normalized image coordinates.
Thus, also distortion parameters of the camera profile can be applied.

Parameters
inputCameraThe pinhole camera profile to be applied for the input frame, must be valid
outputCameraThe pinhole camera profile to be applied for the output frame, must be valid
inputThe input frame that will be transformed, must be valid
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
homographyThe homography used to transform the given input frame by following equation: inputPoint = homography * outputPoint
outputThe output frame using the given homography
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each output mask row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computational load
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
Template Parameters
tChannelsNumber of channels of the frame

◆ homographyWithCameraMask8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::homographyWithCameraMask8BitPerChannelSubset ( const PinholeCamera inputCamera,
const PinholeCamera outputCamera,
const PinholeCamera::DistortionLookup *  outputCameraDistortionLookup,
const uint8_t *  input,
const unsigned int  inputPaddingElements,
const SquareMatrix3 normalizedHomography,
uint8_t *  output,
uint8_t *  outputMask,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
const uint8_t  maskValue,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms an 8 bit per channel frame using the given homography.

Parameters
inputCameraThe pinhole camera profile to be applied for the input frame
outputCameraThe pinhole camera profile to be applied for the output frame
outputCameraDistortionLookupThe distortion lookup table of the of the output camera
inputThe input frame that will be transformed, must be valid
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
normalizedHomographyThe homography used to transform the given input frame specified in normalized camera coordinates
outputThe output frame resulting by application of the given homography
outputMaskMask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each output mask row, in elements, with range [0, infinity)
maskValue8 bit mask values for reference pixels lying inside the given camera frame, reference pixels lying outside the camera frame will be assigned with (0xFF - maskValue)
firstRowThe first row to be handled
numberRowsNumber of rows to be handled
Template Parameters
tChannelsNumber of frame channels

◆ interpolate1PixelFullAlphaBorder8BitPerChannel()

template<unsigned int tChannels, bool tAlphaAtFront, bool tTransparentIs0xFF>
void Ocean::CV::FrameInterpolatorBilinear::interpolate1PixelFullAlphaBorder8BitPerChannel ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const Vector2 position,
uint8_t *  result,
const unsigned int  framePaddingElements 
)
inlinestatic

Determines the interpolated pixel values for a given pixel position in an 8 bit per channel frame with alpha channel.

The center of each pixel is located with an offset of (0.5 x 0.5) in relation to the real pixel position.
The given frame is virtually extended by a fully transparent border so that this functions supports arbitrary interpolation positions.
If the given position lies inside the frame area of (-0.5, -0.5) -> (width + 0.5, height + 0.5) the resulting interpolation result will contain color information of the frame, otherwise a fully transparent interpolation result is provided.

Parameters
frameThe frame to determine the pixel values from, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
positionThe position to determine the interpolated pixel values for, with range (-infinity, infinity)x(-infinity, infinity)
resultResulting pixel values, must be valid
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
Template Parameters
tChannelsNumber of channels of the given frame, with range [1, infinity)
tAlphaAtFrontTrue, if the alpha channel is in the front of the data channels
tTransparentIs0xFFTrue, if 0xFF is interpreted as fully transparent

◆ interpolate4Pixels8BitPerChannelNEON() [1/5]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelNEON ( const uint8_t *  source,
const unsigned int  offsetsTopLeftElements[4],
const unsigned int  offsetsTopRightElements[4],
const unsigned int  offsetsBottomLeftElements[4],
const unsigned int  offsetsBottomRightElements[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 1u >::Type &  borderColor,
const uint32x4_t &  m128_factorsRight,
const uint32x4_t &  m128_factorsBottom,
typename DataType< uint8_t, 1u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelNEON() [2/5]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelNEON ( const uint8_t *  source,
const unsigned int  offsetsTopLeftElements[4],
const unsigned int  offsetsTopRightElements[4],
const unsigned int  offsetsBottomLeftElements[4],
const unsigned int  offsetsBottomRightElements[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 2u >::Type &  borderColor,
const uint32x4_t &  m128_factorsRight,
const uint32x4_t &  m128_factorsBottom,
typename DataType< uint8_t, 2u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelNEON() [3/5]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelNEON ( const uint8_t *  source,
const unsigned int  offsetsTopLeftElements[4],
const unsigned int  offsetsTopRightElements[4],
const unsigned int  offsetsBottomLeftElements[4],
const unsigned int  offsetsBottomRightElements[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 3u >::Type &  borderColor,
const uint32x4_t &  m128_factorsRight,
const uint32x4_t &  m128_factorsBottom,
typename DataType< uint8_t, 3u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelNEON() [4/5]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelNEON ( const uint8_t *  source,
const unsigned int  offsetsTopLeftElements[4],
const unsigned int  offsetsTopRightElements[4],
const unsigned int  offsetsBottomLeftElements[4],
const unsigned int  offsetsBottomRightElements[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 4u >::Type &  borderColor,
const uint32x4_t &  m128_factorsRight,
const uint32x4_t &  m128_factorsBottom,
typename DataType< uint8_t, 4u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelNEON() [5/5]

template<unsigned int tChannels>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelNEON ( const uint8_t *  source,
const unsigned int  offsetsTopLeftElements[4],
const unsigned int  offsetsTopRightElements[4],
const unsigned int  offsetsBottomLeftElements[4],
const unsigned int  offsetsBottomRightElements[4],
const unsigned int  validPixels[4],
const typename DataType< uint8_t, tChannels >::Type &  borderColor,
const uint32x4_t &  m128_factorsRight,
const uint32x4_t &  m128_factorsBottom,
typename DataType< uint8_t, tChannels >::Type *  targetPositionPixels 
)
staticprivate

Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels.

This function also supports to interpolate the pixel values for a subset of the four pixels only, valid pixels will be interpolated, invalid pixels receive a defined border color.

Parameters
sourceThe source image in which the four independent pixels are located, must be valid
offsetsTopLeftElementsThe four offsets within the source image for the four top-left pixels used for the interpolation, in elements, with ranges [0, strideElements * height), or the corresponding validPixel information is 0x00000000
offsetsTopRightElementsThe four offsets within the source image for the four top-right pixels used for the interpolation, in elements, with ranges [0, strideElements * height), or the corresponding validPixel information is 0x00000000
offsetsBottomLeftElementsThe four offsets within the source image for the four bottom-right pixels used for the interpolation, in elements, with ranges [0, strideElements * height), or the corresponding validPixel information is 0x00000000
offsetsBottomRightElementsThe four offsets within the source image for the four bottom-right pixels used for the interpolation, in elements, with ranges [0, strideElements * height), or the corresponding validPixel information is 0x00000000
validPixelsFor boolean states specifying whether which of the given four pixels will be interpolated and which one will receive the defined border color, 0x00000000 for invalid pixels everything else for valid pixels (e.g., 0xFFFFFFFF)
borderColorThe border color that will be assigned to each resulting pixel that is invalid (for which the corresponding validPixel information is 0x00000000
m128_factorsRightThe horizontal interpolation factors for right pixels, with range [0, 128], 128 to use the color information of the right pixels only, 0 to use the color information of the left pixels only
m128_factorsBottomThe vertical interpolation factors for bottom pixels, with range [0, 128], 128 to use the color information of the bottom pixels only, 0 to use the color information of the top pixels only
targetPositionPixelsThe buffer that will receive the interpolated color values, must be valid
Template Parameters
tChannelsThe number of frame channels, with range [1, infinity)

◆ interpolate4Pixels8BitPerChannelSSE() [1/7]

template<unsigned int tChannels>
static OCEAN_FORCE_INLINE __m128i Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const __m128i &  m128_sourcesTopLeft,
const __m128i &  m128_sourcesTopRight,
const __m128i &  m128_sourcesBottomLeft,
const __m128i &  m128_sourcesBottomRight,
const __m128i &  m128_factorsTopLeft,
const __m128i &  m128_factorsTopRight,
const __m128i &  m128_factorsBottomLeft,
const __m128i &  m128_factorsBottomRight 
)
staticprivate

Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels.

This function also supports to interpolate the pixel values for a subset of the four pixels only, valid pixels will be interpolated, invalid pixels receive a defined border color.

Parameters
m128_sourcesTopLeftThe pixel values of the four top left pixels, starting at the first byte may contain unused bytes at the end, e.g., RGBARGBARGBARGBA or YUVYUVYUVYUV-—
m128_sourcesTopRightThe pixel values of the four top right pixels, starting at the first byte may contain unused bytes at the end
m128_sourcesBottomLeftThe pixel values of the four bottom left pixels, starting at the first byte may contain unused bytes at the end
m128_sourcesBottomRightThe pixel values of the four bottom right pixels, starting at the first byte may contain unused bytes at the end
m128_factorsTopLeftThe four interpolation factors of the four top left pixels, with ranges [0, 128 * 128], so that (m128_factorsTopLeft + m128_factorsTopRight + m128_factorsBottomLeft + m128_factorsBottomRight) == (128 * 128)
m128_factorsTopRightThe four interpolation factors of the four top right pixels, with ranges [0, 128 * 128], so that (m128_factorsTopLeft + m128_factorsTopRight + m128_factorsBottomLeft + m128_factorsBottomRight) == (128 * 128)
m128_factorsBottomLeftThe four interpolation factors of the four bottom left pixels, with ranges [0, 128 * 128], so that (m128_factorsTopLeft + m128_factorsTopRight + m128_factorsBottomLeft + m128_factorsBottomRight) == (128 * 128)
m128_factorsBottomRightThe four interpolation factors of the four bottom right pixels, with ranges [0, 128 * 128], so that (m128_factorsTopLeft + m128_factorsTopRight + m128_factorsBottomLeft + m128_factorsBottomRight) == (128 * 128)
Returns
The resulting interpolated pixel values, starting at the first byte may contain unused bytes at the end, e.g., RGBARGBARGBARGBA or YUVYUVYUVYUV-—
Template Parameters
tChannelsThe number of frame channels, with range [3, 4]

◆ interpolate4Pixels8BitPerChannelSSE() [2/7]

template<>
OCEAN_FORCE_INLINE __m128i Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const __m128i &  sourcesTopLeft,
const __m128i &  sourcesTopRight,
const __m128i &  sourcesBottomLeft,
const __m128i &  sourcesBottomRight,
const __m128i &  factorsTopLeft,
const __m128i &  factorsTopRight,
const __m128i &  factorsBottomLeft,
const __m128i &  factorsBottomRight 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelSSE() [3/7]

template<>
OCEAN_FORCE_INLINE __m128i Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const __m128i &  sourcesTopLeft,
const __m128i &  sourcesTopRight,
const __m128i &  sourcesBottomLeft,
const __m128i &  sourcesBottomRight,
const __m128i &  factorsTopLeft,
const __m128i &  factorsTopRight,
const __m128i &  factorsBottomLeft,
const __m128i &  factorsBottomRight 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelSSE() [4/7]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const uint8_t *  source,
const unsigned int  offsetsTopLeft[4],
const unsigned int  offsetsTopRight[4],
const unsigned int  offsetsBottomLeft[4],
const unsigned int  offsetsBottomRight[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 1u >::Type &  borderColor,
const __m128i &  m128_factorsRight,
const __m128i &  m128_factorsBottom,
typename DataType< uint8_t, 1u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelSSE() [5/7]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const uint8_t *  source,
const unsigned int  offsetsTopLeft[4],
const unsigned int  offsetsTopRight[4],
const unsigned int  offsetsBottomLeft[4],
const unsigned int  offsetsBottomRight[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 3u >::Type &  borderColor,
const __m128i &  m128_factorsRight,
const __m128i &  m128_factorsBottom,
typename DataType< uint8_t, 3u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelSSE() [6/7]

template<>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const uint8_t *  source,
const unsigned int  offsetsTopLeft[4],
const unsigned int  offsetsTopRight[4],
const unsigned int  offsetsBottomLeft[4],
const unsigned int  offsetsBottomRight[4],
const unsigned int  validPixels[4],
const DataType< uint8_t, 4u >::Type &  borderColor,
const __m128i &  m128_factorsRight,
const __m128i &  m128_factorsBottom,
typename DataType< uint8_t, 4u >::Type *  targetPositionPixels 
)
staticprivate

◆ interpolate4Pixels8BitPerChannelSSE() [7/7]

template<unsigned int tChannels>
OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate4Pixels8BitPerChannelSSE ( const uint8_t *  source,
const unsigned int  offsetsTopLeft[4],
const unsigned int  offsetsTopRight[4],
const unsigned int  offsetsBottomLeft[4],
const unsigned int  offsetsBottomRight[4],
const unsigned int  validPixels[4],
const typename DataType< uint8_t, tChannels >::Type &  borderColor,
const __m128i &  m128_factorsRight,
const __m128i &  m128_factorsBottom,
typename DataType< uint8_t, tChannels >::Type *  targetPositionPixels 
)
staticprivate

Interpolates 4 independent pixels concurrently based on already known locations (top-left, top-right, bottom-left, and bottom-right) and interpolation factors for the source pixels.

This function also supports to interpolate the pixel values for a subset of the four pixels only, valid pixels will be interpolated, invalid pixels receive a defined border color.

Parameters
sourceThe source image in which the four independent pixels are located, must be valid
offsetsTopLeftThe four offsets within the source image for the four top-left pixels used for the interpolation, with range [0, (width * tChannels + sourcePaddingElements) * (height - 1) + width * tChannels), or the corresponding validPixel information is 0x00000000
offsetsTopRightThe four offsets within the source image for the four top-right pixels used for the interpolation, with range [0, (width * tChannels + sourcePaddingElements) * (height - 1) + width * tChannels), or the corresponding validPixel information is 0x00000000
offsetsBottomLeftThe four offsets within the source image for the four bottom-right pixels used for the interpolation, with range [0, (width * tChannels + sourcePaddingElements) * (height - 1) + width * tChannels), or the corresponding validPixel information is 0x00000000
offsetsBottomRightThe four offsets within the source image for the four bottom-right pixels used for the interpolation, with range [0, (width * tChannels + sourcePaddingElements) * (height - 1) + width * tChannels), or the corresponding validPixel information is 0x00000000
validPixelsFor boolean states specifying whether which of the given four pixels will be interpolated and which one will receive the defined border color, 0x00000000 for invalid pixels everything else for valid pixels (e.g., 0xFFFFFFFF)
borderColorThe border color that will be assigned to each resulting pixel that is invalid (for which the corresponding validPixel information is 0x00000000
m128_factorsRightThe horizontal interpolation factors for right pixels, with range [0, 128], 128 to use the color information of the right pixels only, 0 to use the color information of the left pixels only
m128_factorsBottomThe vertical interpolation factors for bottom pixels, with range [0, 128], 128 to use the color information of the bottom pixels only, 0 to use the color information of the top pixels only
targetPositionPixelsThe buffer that will receive the interpolated color values, must be valid
Template Parameters
tChannelsThe number of frame channels, with range [1, infinity)

◆ interpolate8Pixels1Channel8BitNEON()

OCEAN_FORCE_INLINE void Ocean::CV::FrameInterpolatorBilinear::interpolate8Pixels1Channel8BitNEON ( const uint8x8_t &  topLeft_u_8x8,
const uint8x8_t &  topRight_u_8x8,
const uint8x8_t &  bottomLeft_u_8x8,
const uint8x8_t &  bottomRight_u_8x8,
const uint8x16_t &  factorsRight_factorsBottom_128_u_8x16,
uint8_t *  targetPositionPixels 
)
staticprivate

Interpolates 8 independent pixels concurrently of a 1 channel frame, the source pixel locations must be known already (top-left, top-right, bottom-left, and bottom-right), further the interpolation factors must be known already.

Parameters
topLeft_u_8x8The 8 top left pixel values to be used for interpolation
topRight_u_8x8The 8 top right pixel values to be used for interpolation
bottomLeft_u_8x8The 8 bottom left pixel values to be used for interpolation
bottomRight_u_8x8The 8 bottom right pixel values to be used for interpolation
factorsRight_factorsBottom_128_u_8x16The eight horizontal interpolation factors for right pixels, and the eight vertical interpolation factors for the bottom pixels, with range [0, 128], 128 to use the color information of the right pixels only, 0 to use the color information of the left pixels only
targetPositionPixelsThe buffer that will receive the interpolated color values, must be valid

◆ interpolatePixel()

template<typename TSource , typename TTarget , unsigned int tChannels, PixelCenter tPixelCenter, typename TScalar , typename TIntermediate >
void Ocean::CV::FrameInterpolatorBilinear::interpolatePixel ( const TSource *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  framePaddingElements,
const VectorT2< TScalar > &  position,
TTarget *  result,
const TIntermediate &  resultBias = TIntermediate(0) 
)
inlinestatic

Determines the interpolated pixel values for a given pixel position in a frame with arbitrary data type.

This function uses floating point precision during interpolation.

Parameters
frameThe frame to determine the pixel values from, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
positionThe position for which the interpolated pixel will be determined, with ranges [0, width - 1]x[0, height - 1] for PC_TOP_LEFT, [0, width]x[0, height] for PC_CENTER
resultResulting interpolated pixel value(s), must be valid
resultBiasOptional bias value which will be added to the interpolation result e.g. to handle rounding, with range (-infinity, infinity), default is zero
Template Parameters
TSourceThe data type of the provided pixel values in the (source) frame
TTargetThe data type of the resulting interpolated value(s)
tChannelsNumber of channels of the given frame, with range [1, infinity)
tPixelCenterThe pixel center to be used during interpolation, either 'PC_TOP_LEFT' or 'PC_CENTER'
TScalarThe data type of each coordinate of the provided interpolation location, should be either Scalar, float, or double
TIntermediateThe data type of the intermediate interpolation result before assigning the result
See also
interpolatePixel8BitPerChannel().

◆ interpolatePixel8BitPerChannel()

template<unsigned int tChannels, PixelCenter tPixelCenter, typename TScalar >
void Ocean::CV::FrameInterpolatorBilinear::interpolatePixel8BitPerChannel ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  framePaddingElements,
const VectorT2< TScalar > &  position,
uint8_t *  result 
)
inlinestatic

Determines the interpolated pixel values for a given pixel position in an 8 bit per channel frame.

This function uses an integer interpolation with a precision of 1/128.

Parameters
frameThe frame to determine the pixel values from, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
positionThe position for which the interpolated pixel will be determined, with ranges [0, width - 1]x[0, height - 1] for PC_TOP_LEFT, [0, width]x[0, height] for PC_CENTER
resultResulting pixel values, must be valid, must be valid
Template Parameters
tChannelsNumber of channels of the given frame, with range [1, infinity)
tPixelCenterThe pixel center to be used during interpolation, either 'PC_TOP_LEFT' or 'PC_CENTER'
TScalarThe scalar data type of the sub-pixel position
See also
interpolatePixel().

◆ interpolateRowHorizontal()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::interpolateRowHorizontal ( const T *  extendedSourceRow,
T *  targetRow,
const unsigned int  targetWidth,
const unsigned int  channels,
const unsigned int *  interpolationLocations,
const float *  interpolationFactorsRight 
)
staticprivate

Applies a (horizontal) linear interpolation for one row with arbitrary data type.

This function does not apply any SIMD instructions.

Parameters
extendedSourceRowThe source row extended with a copy of the last pixel for which the interpolation will be applied, must be valid
targetRowThe target row receiving the interpolation result, must be valid
targetWidthThe with of the target row in pixel, with range [8, infinity)
channelsThe number of frame channels, must be identical with 'tChannels', possible values are 1, 4
interpolationLocationsThe successive locations within the source row defining the location of the left pixels to be interpolated (specified in elements !not! in pixels - e.g., interpolationLocations[0] = firstInterpolationPixel * channels), one for each target pixel, with range [0, (targetWidth - 1) * channels]
interpolationFactorsRightThe right interpolation factors for each right source pixel, with range [0, 1]
Template Parameters
TThe data type of each element, should be 'float'
tChannelsThe number of frame channels this function can handle, should be 1
See also
interpolateRowHorizontal8BitPerChannel7BitPrecision().

◆ interpolateRowHorizontal8BitPerChannel7BitPrecision()

static void Ocean::CV::FrameInterpolatorBilinear::interpolateRowHorizontal8BitPerChannel7BitPrecision ( const uint8_t *  extendedSourceRow,
uint8_t *  targetRow,
const unsigned int  targetWidth,
const unsigned int  channels,
const unsigned int *  interpolationLocations,
const uint8_t *  interpolationFactors 
)
staticprivate

Applies a (horizontal) linear interpolation for one row with 8 bit per channel.

This function uses interpolation factors with 7 bit precision and does not apply any SIMD instructions.

Parameters
extendedSourceRowThe source row extended with a copy of the last pixel for which the interpolation will be applied, must be valid
targetRowThe target row receiving the interpolation result, must be valid
targetWidthThe with of the target row in pixel, with range [8, infinity)
channelsThe number of frame channels, must be identical with 'tChannels', possible values are 1, 4
interpolationLocationsThe successive locations within the source row defining the location of the left pixels to be interpolated (specified in elements !not! in pixels - e.g., interpolationLocations[0] = firstInterpolationPixel * channels), one for each target pixel, with range [0, (targetWidth - 1) * channels]
interpolationFactorsThe two successive (left !and! right) interpolation factors for each left and right source pixel, with range [0, 128]
See also
interpolateRowHorizontal8BitPerChannel7BitPrecisionNEON<tChannels>().

◆ interpolateRowHorizontal8BitPerChannel7BitPrecisionNEON()

template<unsigned int tChannels>
static void Ocean::CV::FrameInterpolatorBilinear::interpolateRowHorizontal8BitPerChannel7BitPrecisionNEON ( const uint8_t *  extendedSourceRow,
uint8_t *  targetRow,
const unsigned int  targetWidth,
const unsigned int  channels,
const unsigned int *  interpolationLocations,
const uint8_t *  interpolationFactors 
)
staticprivate

Applies a (horizontal) linear interpolation for one row with 8 bit per channel.

This function applies NEON instructions and uses interpolation factors with 7 bit precision.

Parameters
extendedSourceRowThe source row extended with a copy of the last pixel for which the interpolation will be applied, must be valid
targetRowThe target row receiving the interpolation result, must be valid
targetWidthThe with of the target row in pixel, with range [8, infinity)
channelsThe number of frame channels, must be identical with 'tChannels', possible values are 1, 4
interpolationLocationsThe successive locations within the source row defining the location of the left pixels to be interpolated (specified in elements !not! in pixels - e.g., interpolationLocations[0] = firstInterpolationPixel * channels), one for each target pixel, with range [0, (targetWidth - 1) * channels]
interpolationFactorsThe two successive (left !and! right) interpolation factors for each left and right source pixel, with range [0, 128]
Template Parameters
tChannelsThe number of frame channels this function can handle, possible values are 1, 4
See also
interpolateRowHorizontal8BitPerChannel7BitPrecision().

◆ interpolateRowHorizontalNEON() [1/2]

template<>
void Ocean::CV::FrameInterpolatorBilinear::interpolateRowHorizontalNEON ( const float *  extendedSourceRow,
float *  targetRow,
const unsigned int  targetWidth,
const unsigned int  channels,
const unsigned int *  interpolationLocations,
const float *  interpolationFactorsRight 
)
inlinestaticprivate

◆ interpolateRowHorizontalNEON() [2/2]

template<typename T , unsigned int tChannels>
static void Ocean::CV::FrameInterpolatorBilinear::interpolateRowHorizontalNEON ( const T *  extendedSourceRow,
T *  targetRow,
const unsigned int  targetWidth,
const unsigned int  channels,
const unsigned int *  interpolationLocations,
const float *  interpolationFactorsRight 
)
staticprivate

Applies a (horizontal) linear interpolation for one row with arbitrary data type.

This function applies NEON instructions.

Parameters
extendedSourceRowThe source row extended with a copy of the last pixel for which the interpolation will be applied, must be valid
targetRowThe target row receiving the interpolation result, must be valid
targetWidthThe with of the target row in pixel, with range [8, infinity)
channelsThe number of frame channels, must be identical with 'tChannels', possible values are 1, 4
interpolationLocationsThe successive locations within the source row defining the location of the left pixels to be interpolated (specified in elements !not! in pixels - e.g., interpolationLocations[0] = firstInterpolationPixel * channels), one for each target pixel, with range [0, (targetWidth - 1) * channels]
interpolationFactorsRightThe right interpolation factors for each right source pixel, with range [0, 1]
Template Parameters
TThe data type of each element, should be 'float'
tChannelsThe number of frame channels this function can handle, should be 1
See also
interpolateRowHorizontal8BitPerChannel7BitPrecision().

◆ interpolateRowVertical()

template<typename T >
void Ocean::CV::FrameInterpolatorBilinear::interpolateRowVertical ( const T *  sourceRowTop,
const T *  sourceRowBottom,
T *  targetRow,
const unsigned int  elements,
const float  factorBottom 
)
staticprivate

Applies a (vertical) linear interpolation between two rows with arbitrary data types.

This function does not apply any SIMD instructions.
The length of both source rows is identical with the length of the target row.

Parameters
sourceRowTopThe top source row to be used for interpolation, must be valid
sourceRowBottomThe bottom source row to be used for interpolation, must be valid
targetRowThe target row receiving the interpolation result, must be valid
elementsThe number of elements in the row to (width * channels), with range [1, infinity)
factorBottomThe interpolation factor for all elements of the bottom row, with factorTop = 1 - factorBottom, with range [0, 1]
Template Parameters
TThe data type of each element, should be 'float'

◆ interpolateRowVertical8BitPerChannel7BitPrecisionNEON()

static void Ocean::CV::FrameInterpolatorBilinear::interpolateRowVertical8BitPerChannel7BitPrecisionNEON ( const uint8_t *  sourceRowTop,
const uint8_t *  sourceRowBottom,
uint8_t *  targetRow,
const unsigned int  elements,
const unsigned int  factorBottom 
)
staticprivate

Applies a (vertical) linear interpolation between two rows with 8 bit per channel.

This function applies NEON instructions and uses interpolation factors with 7 bit precision.
The length of both source rows is identical with the length of the target row.

Parameters
sourceRowTopThe top source row to be used for interpolation, must be valid
sourceRowBottomThe bottom source row to be used for interpolation, must be valid
targetRowThe target row receiving the interpolation result, must be valid
elementsThe number of elements in the row to (width * channels), with range [16, infinity)
factorBottomThe interpolation factor for all elements of the bottom row, with factorTop = 128 - factorBottom, with range [0, 128]

◆ interpolateRowVerticalNEON() [1/2]

template<>
void Ocean::CV::FrameInterpolatorBilinear::interpolateRowVerticalNEON ( const float *  sourceRowTop,
const float *  sourceRowBottom,
float *  targetRow,
const unsigned int  elements,
const float  factorBottom 
)
inlinestaticprivate

◆ interpolateRowVerticalNEON() [2/2]

template<typename T >
static void Ocean::CV::FrameInterpolatorBilinear::interpolateRowVerticalNEON ( const T *  sourceRowTop,
const T *  sourceRowBottom,
T *  targetRow,
const unsigned int  elements,
const float  factorBottom 
)
staticprivate

Applies a (vertical) linear interpolation between two rows with arbitrary data types.

This function applies NEON instructions.
The length of both source rows is identical with the length of the target row.

Parameters
sourceRowTopThe top source row to be used for interpolation, must be valid
sourceRowBottomThe bottom source row to be used for interpolation, must be valid
targetRowThe target row receiving the interpolation result, must be valid
elementsThe number of elements in the row to (width * channels), with range [16, infinity)
factorBottomThe interpolation factor for all elements of the bottom row, with factorTop = 1 - factorBottom, with range [0, 1]
Template Parameters
TThe data type of each element, should be 'float'

◆ lookup()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookup ( const T *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
const T *  borderColor,
T *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Transforms a given input frame into an output frame by application of an interpolation lookup table.

The frame must have a 1-plane pixel format.
The output frame must have the same pixel format and pixel origin as the input frame.

Parameters
inputThe input frame which will be transformed, must be valid
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign T(0) to each channel
outputResulting output frame with frame dimension equal to the size of the given lookup table, must be valid
inputPaddingElementsThe number of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each output row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
TData type of each pixel channel, e.g., float, double, int
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ lookup8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookup8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms a subset of a given input frame with uint8_t as element type into an output frame by application of an interpolation lookup table.

The output frame must have the same pixel format and pixel origin as the input frame.

Parameters
inputThe input frame which will be transformed, must be valid
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputResulting output frame with frame dimension equal to the size of the given lookup table
inputPaddingElementsNumber of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsNumber of padding elements at the end of each output row, in elements, with range [0, infinity)
firstRowFirst row to be handled, with range [0, input_LT_output->sizeY())
numberRowsNumber of rows to be handled, with range [1, input_LT_output->sizeY() - firstRow]
Template Parameters
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ lookup8BitPerChannelSubsetNEON() [1/2]

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookup8BitPerChannelSubsetNEON ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms a subset of a given input frame into an output frame by application of an interpolation lookup table and uses NEON instructions.

The output frame must have the same pixel format and pixel origin as the input frame.

Parameters
inputThe input frame which will be transformed, must be valid
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), with table width >= 4, must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign 0x00 to each channel
outputResulting output frame with frame dimension equal to the size of the given lookup table
inputPaddingElementsNumber of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsNumber of padding elements at the end of each output row, in elements, with range [0, infinity)
firstRowFirst row to be handled, with range [0, input_LT_output->sizeY())
numberRowsNumber of rows to be handled, with range [1, input_LT_output->sizeY() - firstRow]
Template Parameters
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ lookup8BitPerChannelSubsetNEON() [2/2]

template<>
void Ocean::CV::FrameInterpolatorBilinear::lookup8BitPerChannelSubsetNEON ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
const uint8_t *  borderColor,
uint8_t *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
inlinestaticprivate

◆ lookupMask8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookupMask8BitPerChannel ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
uint8_t *  output,
uint8_t *  outputMask,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
Worker worker = nullptr,
const uint8_t  maskValue = 0xFF 
)
inlinestatic

Transforms a given input frame into an output frame by application of an interpolation lookup table.

The frame must have a 1-plane pixel format with DT_UNSIGNED_INTEGER_8 as data type (e.g., FORMAT_Y8, FORMAT_RGB24, FORMAT_RGBA32, ...).
The output frame must have the same pixel format and pixel origin as the input frame.
Input frame pixels lying outside the frame will be masked in the resulting output mask frame, further theses pixels are untouched in the output frame.

Parameters
inputThe input frame which will be transformed
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
outputResulting output frame with frame dimension equal to the size of the given lookup table
outputMaskResulting mask frame with 8 bits per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
inputPaddingElementsThe number of padding elements at the end of each row of input, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each row of output, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each row of outputMask, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
maskValue8 bit mask values for pixels lying inside the input frame, pixels lying outside the input frame will be assigned with (0xFF - maskValue)
Template Parameters
tChannelsNumber of channels of the frame

◆ lookupMask8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookupMask8BitPerChannelSubset ( const uint8_t *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
uint8_t *  output,
uint8_t *  outputMask,
const uint8_t  maskValue,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  outputMaskPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms a given input frame into an output frame by application of an interpolation lookup table.

The output frame must have the same pixel format and pixel origin as the input frame.
Input frame pixels lying outside the frame will be masked in the resulting output mask frame, further theses pixels are untouched in the output frame.

Parameters
inputThe input frame which will be transformed
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
outputResulting output frame with frame dimension equal to the size of the given lookup table
outputMaskResulting mask frame with 8 bit per pixel defining whether an output frame pixel has a valid corresponding pixel in the input frame
maskValue8 bit mask values for pixels lying inside the input frame, pixels lying outside the input frame will be assigned with (0xFF - maskValue)
inputPaddingElementsThe number of padding elements at the end of each row of input, in elements, with range [0, infinity)
outputPaddingElementsThe number of padding elements at the end of each row of output, in elements, with range [0, infinity)
outputMaskPaddingElementsThe number of padding elements at the end of each row of outputMask, in elements, with range [0, infinity)
firstRowFirst row to be handled
numberRowsNumber of rows to be handled
Template Parameters
tChannelsNumber of channels of the frame

◆ lookupSubset()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::lookupSubset ( const T *  input,
const unsigned int  inputWidth,
const unsigned int  inputHeight,
const LookupTable input_LT_output,
const bool  offset,
const T *  borderColor,
T *  output,
const unsigned int  inputPaddingElements,
const unsigned int  outputPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprivate

Transforms a subset of a given input frame with arbitrary element type into an output frame by application of an interpolation lookup table.

The output frame must have the same pixel format and pixel origin as the input frame.

Parameters
inputThe input frame which will be transformed, must be valid
inputWidthThe width of the given input frame in pixel, with range [1, infinity)
inputHeightThe height of the given input frame in pixel, with range [1, infinity)
input_LT_outputThe lookup table which defines the transformation from locations defined in the output frame to locations defined in the input frame (the lookup table stores the corresponding locations in the input frame), must be valid
offsetTrue, if the lookup table store local offsets; False, if the lookup table stores absolute positions
borderColorColor of undefined pixel positions, the size of the buffer must match to the number of channels, nullptr to assign T(0) to each channel
outputResulting output frame with frame dimension equal to the size of the given lookup table, must be valid
inputPaddingElementsNumber of padding elements at the end of each input row, in elements, with range [0, infinity)
outputPaddingElementsNumber of padding elements at the end of each output row, in elements, with range [0, infinity)
firstRowFirst row to be handled, with range [0, input_LT_output->sizeY())
numberRowsNumber of rows to be handled, with range [1, input_LT_output->sizeY() - firstRow]
Template Parameters
TData type of each pixel channel, must not be 'uint8_t'
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ patchIntensitySum1Channel()

static Scalar Ocean::CV::FrameInterpolatorBilinear::patchIntensitySum1Channel ( const uint32_t *  linedIntegralFrame,
const unsigned int  frameWidth,
const unsigned int  frameHeight,
const unsigned int  lineIntegralFramePaddingElements,
const Vector2 center,
const CV::PixelCenter  pixelCenter,
const unsigned int  patchWidth,
const unsigned int  patchHeight 
)
static

Interpolate the sum of intensity values of an image patch in a frame, while the frame is provided as lined integral frame.

Parameters
linedIntegralFrameThe lined integral image created from the actual gray-scale image for which the patch intensity sum will be determined, must be valid
frameWidthWidth of the original frame in pixel (not the width of the lined-integral frame), with range [1, infinity)
frameHeightHeight of the original frame in pixel (not the height of the lined-integral frame), with range [1, infinity)
lineIntegralFramePaddingElementsThe number of padding elements at the end of each integral image row, in elements, with range [0, infinity)
center2D coordinates of the center point of the patch, with range [patchWidth/2, frameWidth - patchWidth/2)x[patchHeight/2, frameHeight - patchHeight/2) for PC_CENTER
pixelCenterThe pixel center to be used during interpolation, either 'PC_TOP_LEFT' or 'PC_CENTER'
patchWidthWidth of the calculated patch in pixel with range [1, frameWidth - 1]
patchHeightHeight of the calculated patch in pixel with range [1, frameHeight - 1]
Returns
The resulting sum of the pixel intensities

◆ resampleCameraImage()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::resampleCameraImage ( const T *  sourceFrame,
const AnyCamera sourceCamera,
const SquareMatrix3 source_R_target,
const AnyCamera targetCamera,
T *  targetFrame,
const unsigned int  sourceFramePaddingElements,
const unsigned int  targetFramePaddingElements,
LookupCorner2< Vector2 > *  source_OLT_target = nullptr,
Worker worker = nullptr,
const unsigned int  binSizeInPixel = 8u,
const T *  borderColor = nullptr 
)
static

Re-samples a camera image which has been captured with a camera profile as if the image would have been captured with a second camera profile.

The function can be used e.g., to rectify a fisheye camera image into a pinhole camera image.

Parameters
sourceFrameThe source image captured with the source camera profile, must be valid
sourceCameraThe source camera profile which has been used to capture the source image, with resolution sourceFrame.width() x sourceFrame.height(), must be valid
source_R_targetThe rotation transforming 3D points defined in the coordinate system of the target camera image to 3D points defined in the coordinate system of the source camera image, must be valid
targetCameraThe camera profile of the target frame, must be valid
targetFrameThe resulting target image, with resolution targetCamera.width() x targetCamera.height(), must be valid
sourceFramePaddingElementsThe number of padding elements at the end of each source frame row, in elements, with range [0, infinity)
targetFramePaddingElementsThe number of padding elements at the end of each target frame row, in elements, with range [0, infinity)
source_OLT_targetOptional resulting offset lookup table between target image points and source image points
workerOptional worker object to distribute the computational load
binSizeInPixelThe size in pixel of the interpolation bins used for building the lookup table, with range [1, infinity)
borderColorThe color of border pixels for which now visual content exists, provide one value for each channel, nullptr to use T(0) for each channel
Template Parameters
TData type of each pixel channel, e.g., uint8_t, int16_t, float, double
tChannelsThe number of frame channels, with range [1, infinity)
See also
Comfort::resampleCameraImage().

◆ resize()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::resize ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Resizes a given frame with (almost) arbitrary data type (e.g., float, double, int) by using a bilinear interpolation.

This function is actually a wrapper for scale().

Parameters
sourceThe source frame buffer providing the image information to be resized, must be valid
targetThe target frame buffer receiving the resized image information, must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
targetWidthWidth of the target frame in pixel, with range [1, infinity)
targetHeightHeight of the target frame in pixel, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation to several CPU cores
Template Parameters
TData type of each pixel channel, e.g., float, double, int
tChannelsNumber of channels of the frame, with range [1, infinity)
See also
scale<T, tChannels>().

◆ rotate8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::rotate8BitPerChannel ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const Scalar  horizontalAnchorPosition,
const Scalar  verticalAnchorPosition,
const Scalar  angle,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr,
const uint8_t *  borderColor = nullptr 
)
inlinestatic

Rotates a given frame by a bilinear interpolation.

The frame will be rotated around a specified anchor position (inside or outside the frame).

Parameters
sourceThe source frame to be rotated, must be valid
targetThe target frame which will receive the rotated image, with same frame type as the source frame, must be valid
widthThe width of the source and target frame in pixel, with range [1, infinity)
heightThe height of the source and target frame in pixel, with range [1, infinity)
horizontalAnchorPositionPosition of the rotation anchor in the horizontal direction, with range (-infinity, infinity)
verticalAnchorPositionPosition of the rotation anchor in the vertical direction, with range (-infinity, infinity)
angleThe counter clockwise rotation angle in radian, with range [0, 2PI)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation to several CPU cores
borderColorThe color of border pixels for which now visual content exists, provide one value for each channel, nullptr to use 0x00 for each channel
Template Parameters
tChannelsThe number of channels both frames have, with range [1, infinity)

◆ rotate8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::rotate8BitPerChannelSubset ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const Scalar  horizontalAnchorPosition,
const Scalar  verticalAnchorPosition,
const Scalar  angle,
const uint8_t *  borderColor,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
staticprivate

Rotates a subset of a given frame by a bilinear interpolation.

Parameters
sourceThe source frame to be rotated, must be valid
targetThe target frame which will receive the rotated image, with same frame type as the source frame, must be valid
widthThe width of the source and target frame in pixel, with range [1, infinity)
heightThe height of the source and target frame in pixel, with range [1, infinity)
horizontalAnchorPositionPosition of the rotation anchor in the horizontal direction, with range (-infinity, infinity)
verticalAnchorPositionPosition of the rotation anchor in the vertical direction, with range (-infinity, infinity)
angleThe counter clockwise rotation angle in radian, with range [0, 2PI)
borderColorThe color of border pixels for which now visual content exists, provide one value for each channel, nullptr to use 0x00 for each channel
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstTargetRowThe first row of the target frame to be handled, with range [0, height)
numberTargetRowsThe number of rows in the target frame to be handled, with range [1, height - firstTargetRow]
Template Parameters
tChannelsNumber of frame channels, with range [1, infinity)

◆ scale()

template<typename T , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::scale ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Rescales a given frame with arbitrary data type (e.g., float, double, int) by using a bilinear interpolation with user-defined scaling factors.

Beware: This function is not optimized for performance but supports arbitrary data types.
Try to use scale8BitPerChannel() if possible.

Parameters
sourceThe source frame buffer providing the image information to be resized, must be valid
targetThe target frame buffer receiving the rescaled image information, must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
targetWidthWidth of the target frame in pixel, with range [1, infinity)
targetHeightHeight of the target frame in pixel, with range [1, infinity)
sourceX_s_targetXThe horizontal scale factor converting a location in the target frame to a location in the source frame (xSource = sourceX_s_targetX * xTarget), with range (0, sourceWidth/targetWidth]
sourceY_s_targetYThe vertical scale factor converting a location in the target frame to a location in the source frame (ySource = sourceY_s_targetY * yTarget), with range (0, sourceHeight/targetHeight]
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation to several CPU cores
Template Parameters
TData type of each pixel channel, e.g., float, double, int
tChannelsNumber of channels of the frame, with range [1, infinity)
See also
resize<T, tChannels>().

◆ scale8BitPerChannel()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::scale8BitPerChannel ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestaticprivate

Rescales a given frame with 8 bit per data channel by using a bilinear interpolation with user-defined scaling factors.

The frame must have a 1-plane pixel format with DT_UNSIGNED_INTEGER_8 as data type (e.g., FORMAT_Y8, FORMAT_RGB24, FORMAT_RGBA32, ...).
Information: This function is the equivalent to OpenCV's cv::resize().

Parameters
sourceThe source frame buffer providing the image information to be resized, must be valid
targetThe target frame buffer receiving the rescaled image information, must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
targetWidthWidth of the target frame in pixel, with range [1, infinity)
targetHeightHeight of the target frame in pixel, with range [1, infinity)
sourceX_s_targetXThe horizontal scale factor converting a location in the target frame to a location in the source frame (xSource = sourceX_s_targetX * xTarget), with range (0, sourceWidth/targetWidth]
sourceY_s_targetYThe vertical scale factor converting a location in the target frame to a location in the source frame (ySource = sourceY_s_targetY * yTarget), with range (0, sourceHeight/targetHeight]
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation to several CPU cores
Template Parameters
tChannelsNumber of channels of the frame, with range [1, infinity)

◆ scale8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::scale8BitPerChannelSubset ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
staticprivate

Resizes a subset of a given frame with 8 bit per channel by a bilinear interpolation.

Parameters
sourceThe image data of the source frame to be resized, must be valid
targetThe target frame buffer receiving the interpolated (resized) source frame, must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
targetWidthWidth of the target frame in pixel, with range [1, infinity)
targetHeightHeight of the target frame in pixel, with range [1, infinity)
sourceX_s_targetXThe horizontal scale factor converting a location in the target frame to a location in the source frame (xSource = sourceX_s_targetX * xTarget), with range (0, sourceWidth/targetWidth]
sourceY_s_targetYThe vertical scale factor converting a location in the target frame to a location in the source frame (ySource = sourceY_s_targetY * yTarget), with range (0, sourceHeight/targetHeight]
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstTargetRowThe first target row to be handled, with range [0, targetHeight)
numberTargetRowsThe number of target row to be handled, with range [1, targetHeight - firstTargetRow]
Template Parameters
tChannelsNumber of frame channels, with range [0, infinity)

◆ scale8BitPerChannelSubset7BitPrecisionNEON()

void Ocean::CV::FrameInterpolatorBilinear::scale8BitPerChannelSubset7BitPrecisionNEON< 3u, 8u > ( const uint8_t *  source,
uint8_t *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const unsigned int  channels,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
inlinestaticprivate

Rescales a subset of a given frame with 8 bit per channel by a bilinear interpolation.

This function applies NEON instructions and uses interpolation factors with 7 bit precision.

Parameters
sourceThe image data of the source frame to be resized, must be valid
targetThe target frame buffer receiving the interpolated (resized) source frame, must be valid
sourceWidthWidth of the source frame in pixel, with range [2, 65.535]
sourceHeightHeight of the source frame in pixel, with range [1, 65.535]
targetWidthWidth of the target frame in pixel, with range [tMinimalTargetWidth, 65.535]
targetHeightHeight of the target frame in pixel, with range [1, infinity)
channelsThe number of channels both frames have, with range [1, infinity)
sourceX_s_targetXThe horizontal scale factor converting a location in the target frame to a location in the source frame (xSource = sourceX_s_targetX * xTarget), with range (0, sourceWidth/targetWidth]
sourceY_s_targetYThe vertical scale factor converting a location in the target frame to a location in the source frame (ySource = sourceY_s_targetY * yTarget), with range (0, sourceHeight/targetHeight]
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstTargetRowThe first target row to be handled, with range [0, targetHeight)
numberTargetRowsThe number of target row to be handled, with range [1, targetHeight - firstTargetRow]
See also
interpolateRowVertical8BitPerChannel7BitPrecisionNEON(), interpolateRowHorizontal8BitPerChannel7BitPrecisionNEON().

◆ scaleSubset() [1/2]

template<>
void Ocean::CV::FrameInterpolatorBilinear::scaleSubset ( const float *  source,
float *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
inlinestaticprivate

◆ scaleSubset() [2/2]

template<typename T , typename TScale , unsigned int tChannels>
void Ocean::CV::FrameInterpolatorBilinear::scaleSubset ( const T *  source,
T *  target,
const unsigned int  sourceWidth,
const unsigned int  sourceHeight,
const unsigned int  targetWidth,
const unsigned int  targetHeight,
const double  sourceX_s_targetX,
const double  sourceY_s_targetY,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstTargetRow,
const unsigned int  numberTargetRows 
)
staticprivate

Resizes a subset of a given frame with arbitrary data type by a bilinear interpolation.

Parameters
sourceThe image data of the source frame to be resized, must be valid
targetThe target frame buffer receiving the interpolated (resized) source frame, must be valid
sourceWidthWidth of the source frame in pixel, with range [1, infinity)
sourceHeightHeight of the source frame in pixel, with range [1, infinity)
targetWidthWidth of the target frame in pixel, with range [1, infinity)
targetHeightHeight of the target frame in pixel, with range [1, infinity)
sourceX_s_targetXThe horizontal scale factor converting a location in the target frame to a location in the source frame (xSource = sourceX_s_targetX * xTarget), with range (0, sourceWidth/targetWidth]
sourceY_s_targetYThe vertical scale factor converting a location in the target frame to a location in the source frame (ySource = sourceY_s_targetY * yTarget), with range (0, sourceHeight/targetHeight]
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstTargetRowThe first target row to be handled, with range [0, targetHeight)
numberTargetRowsThe number of target row to be handled, with range [1, targetHeight - firstTargetRow]
Template Parameters
TThe data type of each pixel channel, e.g., float, double, int, short, ...
TScaleThe data type of the internal scaling factors to be used, should be 'float' or 'double'
tChannelsNumber of frame channels, with range [0, infinity)

The documentation for this class was generated from the following file: