Ocean
Ocean::CV::FrameOperations Class Reference

Class for commonly used (arithmetic) operators on and between frames. More...

Data Structures

struct  Operations
 Collections of pixel operations. More...
 

Static Public Member Functions

static bool subtract (const Frame &source0, const Frame &source1, Frame &target, Worker *worker=nullptr)
 Computes the difference between two frames and stores the difference. More...
 
template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tChannels>
static void subtract (const TSource0 *source0, const TSource1 *source1, TTarget *target, const unsigned int width, const unsigned int height, const unsigned int source0PaddingElements, const unsigned int source1PaddingElements, const unsigned int targetPaddingElements, const FrameChannels::ConversionFlag conversionFlag=FrameChannels::CONVERT_NORMAL, Worker *worker=nullptr)
 Computes the difference between two frames The pixel-wise subtraction of two frames is defined as C(y,x) = A(y,x) - B(y,x) More...
 

Detailed Description

Class for commonly used (arithmetic) operators on and between frames.

Member Function Documentation

◆ subtract() [1/2]

static bool Ocean::CV::FrameOperations::subtract ( const Frame source0,
const Frame source1,
Frame target,
Worker worker = nullptr 
)
static

Computes the difference between two frames and stores the difference.

For the pixel-wise subtraction of

A and B, C_i = A_i - B_i,

where i is the index of a pixel.

Note
Refrain from using this function, if binary size is important, e.g. for development on mobile platform. Instead use the pointer-based function subtract()
Parameters
source0First source frame, must be valid
source1Second source frame, must be valid and have the same type as source0
targetResulting frame, must be valid and have the same type as source0
workerOptional worker instance for parallelization
Returns
True on success, otherwise false (e.g., for unsupported pixel formats, or mismatch of pixel formats)

◆ subtract() [2/2]

template<typename TSource0 , typename TSource1 , typename TTarget , typename TIntermediate , unsigned int tChannels>
void Ocean::CV::FrameOperations::subtract ( const TSource0 *  source0,
const TSource1 *  source1,
TTarget *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  source0PaddingElements,
const unsigned int  source1PaddingElements,
const unsigned int  targetPaddingElements,
const FrameChannels::ConversionFlag  conversionFlag = FrameChannels::CONVERT_NORMAL,
Worker worker = nullptr 
)
static

Computes the difference between two frames The pixel-wise subtraction of two frames is defined as C(y,x) = A(y,x) - B(y,x)

Parameters
source0Pointer to the first source, must not be null
source1Pointer to the second source, must not be null
targetPointer to the result location, must not be null
widthThe width of the sources and the target (must all be equal)
heightThe height of the sources and the target (must all be equal)
source0PaddingElementsThe number of padding elements at the end of each row of the first source, in elements, with range [0, infinity)
source1PaddingElementsThe number of padding elements at the end of each row of the second source, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
conversionFlagDetermines the type of conversion
workerOptional worker instance for parallelization
Template Parameters
TSource0Data type of the first source
TSource1Data type of the second source
TTargetData type of the output
TIntermediateData type for the computation of intermediate results (before the conversion to TTarget)
tChannelsNumber of channels of the sources and the target

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