Class for commonly used (arithmetic) operators on and between frames.
More...
|
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...
|
|
Class for commonly used (arithmetic) operators on and between frames.
◆ 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
-
source0 | First source frame, must be valid |
source1 | Second source frame, must be valid and have the same type as source0 |
target | Resulting frame, must be valid and have the same type as source0 |
worker | Optional 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
-
source0 | Pointer to the first source, must not be null |
source1 | Pointer to the second source, must not be null |
target | Pointer to the result location, must not be null |
width | The width of the sources and the target (must all be equal) |
height | The height of the sources and the target (must all be equal) |
source0PaddingElements | The number of padding elements at the end of each row of the first source, in elements, with range [0, infinity) |
source1PaddingElements | The number of padding elements at the end of each row of the second source, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
conversionFlag | Determines the type of conversion |
worker | Optional worker instance for parallelization |
- Template Parameters
-
TSource0 | Data type of the first source |
TSource1 | Data type of the second source |
TTarget | Data type of the output |
TIntermediate | Data type for the computation of intermediate results (before the conversion to TTarget ) |
tChannels | Number of channels of the sources and the target |
The documentation for this class was generated from the following file: