Ocean
|
This class implements functions allowing dense image alignment. More...
Data Structures | |
class | ConsistencyData |
Definition of an abstract base class allowing to store consistency data. More... | |
class | DenseAdditiveHomographyProvider |
class | DenseInverseCompositionalHomographyProvider |
class | HomographyProvider |
Public Types | |
typedef ObjectRef< ConsistencyData > | ConsistencyDataRef |
Definition of an object reference holding a consistency data object. More... | |
Static Public Member Functions | |
static bool | optimizeAlignmentAdditive (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &roughHomography, const unsigned int homographyParameters, const bool zeroMean, SquareMatrix3 &homography, const unsigned int iterations=20u, Scalar lambda=10, const Scalar lambdaFactor=10, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr, ConsistencyDataRef *externalConsistencyData=nullptr, bool *abort=nullptr) |
Optimizes the alignment between two images within a specified sub-region regarding a homography by application of an iterative additive delta Levenberg-Marquardt optimization approach. More... | |
static bool | optimizeAlignmentInverseCompositional (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &roughHomography, const unsigned int homographyParameters, const bool zeroMean, SquareMatrix3 &homography, const unsigned int iterations=20u, Scalar lambda=10, const Scalar lambdaFactor=10, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr, ConsistencyDataRef *externalConsistencyData=nullptr, bool *abort=nullptr) |
Optimizes the alignment between two images within a specified sub-region regarding a homography by application of an iterative inverse compositional delta Levenberg-Marquardt optimization approach. More... | |
static bool | optimizeAlignmentMultiResolution (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const unsigned int numberPyramidLayers, const unsigned int homographyParameters, const bool additiveAlignment, const bool levenbergMarquardtOptimization, const bool zeroMean, const SquareMatrix3 &roughHomography, SquareMatrix3 &homography, const unsigned int coarseIterations=20u, const unsigned int fineIterations=4u, const CV::FramePyramid::DownsamplingMode downsamplingMode=CV::FramePyramid::DM_FILTER_14641) |
Optimizes the alignment between two images within a specified sub-region regarding a homography by applying a multi-resolution (coarse to fine approach) Gauss-Newton or a Levenberg-Marquardt optimization approach. More... | |
static bool | optimizeAlignmentMultiResolution (const CV::FramePyramid &templateFramePyramid, const std::vector< CV::SubRegion > &templateSubRegions, const CV::FramePyramid ¤tFramePyramid, const unsigned int layers, const unsigned int homographyParameters, const bool additiveAlignment, const bool levenbergMarquardtOptimization, const bool zeroMean, const SquareMatrix3 &roughHomography, SquareMatrix3 &homography, const unsigned int coarseIterations=20u, const unsigned int fineIterations=4u, std::vector< Tracking::HomographyImageAlignmentDense::ConsistencyDataRef > *consistencyDatas=nullptr) |
Optimizes the alignment between two images within a specified sub-region regarding a homography by applying a multi-resolution (coarse to fine approach) Gauss-Newton or a Levenberg-Marquardt optimization approach. More... | |
Static Protected Member Functions | |
static Scalar | slowDetermineError (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &homography, const bool zeroMean) |
Determines the current error for a given homography between a current frame and a template frame within a sub-region of the template frame. More... | |
template<unsigned int tChannels> | |
static Scalar | slowDetermineError8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &homography, const bool zeroMean) |
Determines the current error for a given homography between a current frame and a template frame within a sub-region of the template frame. More... | |
template<unsigned int tParameters> | |
static bool | slowDetermineHessianAndErrorJacobian (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &homography, const bool zeroMean, Matrix &hessian, Matrix &jacobianError) |
Determines the 8x8 or 9x9 Hessian matrix and the 8x1 or 9x1 Jacobian-Error vector for a given homography between a current frame and a template frame within a sub-region of the template frame. More... | |
template<unsigned int tParameters, unsigned int tChannels> | |
static bool | slowDetermineHessianAndErrorJacobian8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame ¤tFrame, const SquareMatrix3 &homography, const bool zeroMean, Matrix &hessian, Matrix &jacobianError) |
Determines the 8x8 or 9x9 Hessian matrix and the 8x1 or 9x1 Jacobian-Error vector for a given homography between a current frame and a template frame within a sub-region of the template frame. More... | |
template<unsigned int tChannels, bool tDetermineTemplateMeans> | |
static bool | determineMeans8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame &transformedCurrentSubFrame, const Frame &transformedCurrentSubFrameMask, Scalar *templateMeans, Scalar *currentMeans, Worker *worker) |
Determines the mean color intensities in the corresponding sub-regions of the current transformed frame and also optional in the template frame while optional a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tChannels, bool tUseMeans> | |
static Scalar | determineError8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame &transformedCurrentSubFrameData, const Frame &transformedCurrentSubFrameMaskData, const Scalar *templateMeans, const Scalar *currentMeans, Worker *worker) |
Determines the color intensity error within a sub-region between a template frame and a transformed current frame while optional a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tParameters, unsigned int tChannels, bool tUseMeans> | |
static void | determineHessianAndErrorJacobian8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame &transformedCurrentSubFrame, const Frame &transformedCurrentSubFrameMask, const unsigned int transformedBoundingBoxLeft, const unsigned int transformedBoundingBoxTop, const unsigned int transformedBoundingBoxWidth, const unsigned int transformedBoundingBoxHeight, const Frame &gradientCurrentFrame, const SquareMatrix3 &homography, const Scalar *templateMeans, const Scalar *currentMeans, Matrix &hessian, Matrix &jacobianError, Worker *worker) |
Determines the Hessian matrix and the product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tParameters, unsigned int tChannels, bool tUseMeans> | |
static void | determineErrorJacobianInverseCompositional8BitPerChannel (const Frame &templateFrame, const CV::SubRegion &templateSubRegion, const Frame &transformedCurrentSubFrame, const Frame &transformedCurrentSubFrameMask, const Scalar *templateMeans, const Scalar *currentMeans, const Scalar *jacobianRows, Matrix &jacobianError, Worker *worker) |
Determines the product of transposed Jacobian matrix and error vector for the inverse compositional optimization approach for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tChannels, bool tDetermineTemplateMeans> | |
static void | determineMeans8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, Scalar *templateMeans, Scalar *currentMeans, unsigned int *templateMeansDenominator, unsigned int *currentMeansDenominator, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the mean color intensities in a subset of the corresponding sub-regions of the current transformed frame and also optional in the template frame. More... | |
template<unsigned int tChannels, bool tDetermineTemplateMeans> | |
static void | determineMeansMask8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const Frame *transformedCurrentSubFrameMask, Scalar *templateMeans, Scalar *currentMeans, unsigned int *templateMeansDenominator, unsigned int *currentMeansDenominator, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the mean color intensities in a subset of the corresponding sub-regions of the current transformed frame and also optional in the template frame. More... | |
template<unsigned int tChannels, bool tUseMeans> | |
static void | determineError8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const Scalar *templateMeans, const Scalar *currentMeans, Scalar *squaredError, unsigned int *errorDenominators, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the color intensity error in a subset of a sub-region between a template frame and a transformed current frame. More... | |
template<unsigned int tChannels, bool tUseMeans> | |
static void | determineErrorMask8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const Frame *transformedCurrentSubFrameMask, const Scalar *templateMeans, const Scalar *currentMeans, Scalar *squaredError, unsigned int *errorDenominators, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the color intensity error in a subset of a sub-region between a template frame and a transformed current frame while a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tParameters, unsigned int tChannels, bool tUseMeans> | |
static void | determineHessianAndErrorJacobian8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const unsigned int transformedBoundingBoxLeft, const unsigned int transformedBoundingBoxTop, const unsigned int transformedBoundingBoxWidth, const unsigned int transformedBoundingBoxHeight, const Frame *gradientCurrentFrame, const SquareMatrix3 *homography, const Scalar *templateMeans, const Scalar *currentMeans, Matrix *hessian, Matrix *jacobianError, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the subset-Hessian matrix and the subset-product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region. More... | |
template<unsigned int tParameters, unsigned int tChannels, bool tUseMeans> | |
static void | determineErrorJacobianInverseCompositional8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const Scalar *templateMeans, const Scalar *currentMeans, const Scalar *jacobianRows, Matrix *jacobianError, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the subset of the product of transposed Jacobian matrix and error vector for the inverse compositional optimization approach for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination). More... | |
template<unsigned int tParameters, unsigned int tChannels, bool tUseMeans> | |
static void | determineHessianAndErrorJacobianMask8BitPerChannelSubset (const Frame *templateFrame, const CV::SubRegion *templateSubRegion, const Frame *transformedCurrentSubFrame, const Frame *transformedCurrentSubFrameMask, const unsigned int transformedBoundingBoxLeft, const unsigned int transformedBoundingBoxTop, const unsigned int transformedBoundingBoxWidth, const unsigned int transformedBoundingBoxHeight, const Frame *gradientCurrentFrame, const SquareMatrix3 *current_H_template, const Scalar *templateMeans, const Scalar *currentMeans, Matrix *hessian, Matrix *jacobianError, Lock *lock, const unsigned int threads, const unsigned int threadIndex, const unsigned int unused) |
Determines the subset-Hessian matrix and the subset-product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region. More... | |
This class implements functions allowing dense image alignment.
typedef ObjectRef<ConsistencyData> Ocean::Tracking::HomographyImageAlignmentDense::ConsistencyDataRef |
Definition of an object reference holding a consistency data object.
|
inlinestaticprotected |
Determines the color intensity error within a sub-region between a template frame and a transformed current frame while optional a mask frame defines valid and invalid pixels (not counting for error determination).
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The frame data of the template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrameData | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMaskData | Optional mask that has been created during the creation of the sub-region of the transformed current frame, nullptr to avoid the usage of a mask which is more efficient |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
worker | Optional worker object to distribute the computation |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
staticprotected |
Determines the color intensity error in a subset of a sub-region between a template frame and a transformed current frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
squaredError | The resulting sum of squared errors, must be initialized with 0 |
errorDenominators | The number of pixels that have been used to determine the error, must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
inlinestaticprotected |
Determines the product of transposed Jacobian matrix and error vector for the inverse compositional optimization approach for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | Optional mask that has been created during the creation of the sub-region of the transformed current frame, nullptr to avoid the usage of any mask which is more efficient |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
jacobianRows | The already determine (and constant) Jacobian rows for each pixel and channel of the template sub-region, each row has dimension (1 x tParameters) |
jacobianError | The resulting product of transposed Jacobian matrix and error vector, with dimension (tParameters x 1) |
worker | Optional worker object to distribute the computation |
tParameters | The number of parameters that are used to optimize the homography, with range [8, 9] |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
staticprotected |
Determines the subset of the product of transposed Jacobian matrix and error vector for the inverse compositional optimization approach for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
jacobianRows | The already determine (and constant) Jacobian rows for each pixel and channel of the template sub-region, each row has dimension (1 x tParameters) |
jacobianError | The resulting product of transposed Jacobian matrix and error vector, with dimension (tParameters x 1), must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tParameters | The number of parameters that are used to optimize the homography, with range [8, 9] |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
staticprotected |
Determines the color intensity error in a subset of a sub-region between a template frame and a transformed current frame while a mask frame defines valid and invalid pixels (not counting for error determination).
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | The mask that has been created during the creation of the sub-region of the transformed current frame |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
squaredError | The resulting sum of squared errors, must be initialized with 0 |
errorDenominators | The number of pixels that have been used to determine the error, must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
inlinestaticprotected |
Determines the Hessian matrix and the product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region while optional a mask frame defines valid and invalid pixels (not counting for error determination).
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | Optional mask that has been created during the creation of the sub-region of the transformed current frame, nullptr to avoid the usage of any mask which is more efficient |
transformedBoundingBoxLeft | The left border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.width()) |
transformedBoundingBoxTop | the top border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.height()) |
transformedBoundingBoxWidth | The width of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.width() - transformedBoundingBoxLeft] |
transformedBoundingBoxHeight | The height of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.height() - transformedBoundingBoxTop] |
gradientCurrentFrame | The gradient filter responses of the current frame restricted to the location and size of the transformed bounding box, must be valid |
homography | The homography to be used to transform the current frame with |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
hessian | The resulting Hessian matrix, with dimension (tParameters x tParameters) |
jacobianError | The resulting product of transposed Jacobian matrix and error vector, with dimension (tParameters x 1) |
worker | Optional worker object to distribute the computation |
tParameters | The number of parameters that are used to optimize the homography, with range [8, 9] |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
staticprotected |
Determines the subset-Hessian matrix and the subset-product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedBoundingBoxLeft | The left border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.width()) |
transformedBoundingBoxTop | the top border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.height()) |
transformedBoundingBoxWidth | The width of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.width() - transformedBoundingBoxLeft] |
transformedBoundingBoxHeight | The height of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.height() - transformedBoundingBoxTop] |
gradientCurrentFrame | The gradient filter responses of the current frame restricted to the location and size of the transformed bounding box, must be valid |
homography | The homography to be used to transform the current frame with |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
hessian | The resulting Hessian matrix, with dimension (tParameters x tParameters), must be initialized with 0 |
jacobianError | The resulting product of transposed Jacobian matrix and error vector, with dimension (tParameters x 1), must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tParameters | The number of parameters that are used to optimize the homography, with range [8, 9] |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
staticprotected |
Determines the subset-Hessian matrix and the subset-product of transposed Jacobian matrix and error vector for a template frame and current transformed frame within a sub-region.
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region for which the error is determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | The mask that has been created during the creation of the sub-region of the transformed current frame |
transformedBoundingBoxLeft | The left border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.width()) |
transformedBoundingBoxTop | the top border of the bounding box of the transformed sub-region in pixel, with range [0, currentFrame.height()) |
transformedBoundingBoxWidth | The width of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.width() - transformedBoundingBoxLeft] |
transformedBoundingBoxHeight | The height of the bounding box of the transformed sub-region in pixel, with range [1, currentFrame.height() - transformedBoundingBoxTop] |
gradientCurrentFrame | The gradient filter responses of the current frame restricted to the location and size of the transformed bounding box, must be valid |
current_H_template | The homography converting the template image to the current image, must be valid |
templateMeans | The mean color intensities in the sub-region of the template frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
currentMeans | The mean color intensities in the current transformed frame, must be defined if 'tUseMeans' is True; otherwise nullptr |
hessian | The resulting Hessian matrix, with dimension (tParameters x tParameters), must be initialized with 0 |
jacobianError | The resulting product of transposed Jacobian matrix and error vector, with dimension (tParameters x 1), must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tParameters | The number of parameters that are used to optimize the homography, with range [8, 9] |
tChannels | The number of data channels of the provided frames |
tUseMeans | True, if the mean color intensities are used to determine the errors; False, otherwise |
|
inlinestaticprotected |
Determines the mean color intensities in the corresponding sub-regions of the current transformed frame and also optional in the template frame while optional a mask frame defines valid and invalid pixels (not counting for error determination).
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region in which the mean color intensities are determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | Optional mask that has been created during the creation of the sub-region of the transformed current frame, nullptr to avoid the usage of any mask which is more efficient |
templateMeans | The resulting mean color intensities in the template frame, if 'tDetermineTemplateMeans' is True |
currentMeans | The resulting mean color intensities in the current transformed frame |
worker | Optional worker object to distribute the computation |
tChannels | The number of data channels of the provided frames |
tDetermineTemplateMeans | True, to determine the mean intensities for the current frame and the template frame; False, to determine the mean intensities for the current frame only |
|
staticprotected |
Determines the mean color intensities in a subset of the corresponding sub-regions of the current transformed frame and also optional in the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region in which the mean color intensities are determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
templateMeans | The resulting sum of color intensities in the template frame, if 'tDetermineTemplateMeans' is True, must be initialized with 0 |
currentMeans | The resulting sum of color intensities in the current transformed frame, must be initialized with 0 |
templateMeansDenominator | The number of pixels that have been used to determine the sum of intensities in the template frame, must be initialized with 0 |
currentMeansDenominator | The number of pixels that have been used to determine the sum of intensities in the current transformed frame, must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tChannels | The number of data channels of the provided frames |
tDetermineTemplateMeans | True, to determine the mean intensities for the current frame and the template frame; False, to determine the mean intensities for the current frame only |
|
staticprotected |
Determines the mean color intensities in a subset of the corresponding sub-regions of the current transformed frame and also optional in the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region in which the mean color intensities are determined, defined in the template frame |
transformedCurrentSubFrame | The sub-region from the transformed current frame, needs to be transformed with the homography with size and location equal to the sub-region |
transformedCurrentSubFrameMask | The mask that has been created during the creation of the sub-region of the transformed current frame |
templateMeans | The resulting sum of color intensities in the template frame, if 'tDetermineTemplateMeans' is True, must be initialized with 0 |
currentMeans | The resulting sum of color intensities in the current transformed frame, must be initialized with 0 |
templateMeansDenominator | The number of pixels that have been used to determine the sum of intensities in the template frame, must be initialized with 0 |
currentMeansDenominator | The number of pixels that have been used to determine the sum of intensities in the current transformed frame, must be initialized with 0 |
lock | The lock object necessary if this function is executed on multiple threads in parallel, nullptr otherwise |
threads | The number of threads on which this function is executed in parallel |
threadIndex | The index of the current thread, with range [0, threads) |
unused | An unused parameter must be 1 |
tChannels | The number of data channels of the provided frames |
tDetermineTemplateMeans | True, to determine the mean intensities for the current frame and the template frame; False, to determine the mean intensities for the current frame only |
|
static |
Optimizes the alignment between two images within a specified sub-region regarding a homography by application of an iterative additive delta Levenberg-Marquardt optimization approach.
The resulting homography converts points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint), the given rough homography must be defined accordingly.
The performance of this function can be improved further if this function is invoked successively for the same template frame with identical parameters but with individual current frames.
In this case, an empty consistency data object must be provided for the first call, stored outside and must again be provided for the successive calls.
templateFrame | The template frame defining the reference to which the current frame will be aligned, must be valid |
templateSubRegion | The sub-region defined within the template frame from which the visual content is used for the alignment, image content outside the sub-region is not investigated, must be valid |
currentFrame | The current frame for which the alignment will be determine, must have the same pixel format and pixel origin as the template frame |
roughHomography | An already rough homography defining the alignment between template and current frame, the homography transforms points defined in the template frame to points defined in the current frame |
homographyParameters | The number of parameters used to define the homography, with range [8, 9] |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
homography | The resulting optimized homography for the specified template frame and current frame, with 1 in the lower right corner |
iterations | The number of optimization iterations that will be applied at most, with range [1, infinity) |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting initial averaged squared error between template and current frame within the sub-region |
finalError | Optional resulting final averaged squared error between template and current frame within the sub-region |
intermediateErrors | Optional resulting intermediate averaged squared errors, on error for each improving optimization iteration |
abort | Optional abort statement allowing to abort the alignment at any time; set the value True to abort the alignment |
externalConsistencyData | Optional abstract consistency data object that may be used to improve the overall performance for several successive optimization calls for individual current frames but with the same template frame |
|
static |
Optimizes the alignment between two images within a specified sub-region regarding a homography by application of an iterative inverse compositional delta Levenberg-Marquardt optimization approach.
The resulting homography converts points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint), the given rough homography must be defined accordingly.
The performance of this function can be improved further if this function is invoked successively for the same template frame with identical parameters but with individual current frames.
In this case, an empty consistency data object must be provided for the first call, stored outside and must again be provided for the successive calls.
templateFrame | The template frame defining the reference to which the current frame will be aligned, must be valid |
templateSubRegion | The sub-region defined within the template frame from which the visual content is used for the alignment, image content outside the sub-region is not investigated, must be valid |
currentFrame | The current frame for which the alignment will be determine, must have the same pixel format and pixel origin as the template frame |
roughHomography | An already rough homography defining the alignment between template and current frame, the homography transforms points defined in the template frame to points defined in the current frame |
homographyParameters | The number of parameters used to define the homography, with range [8, 9] |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
homography | The resulting optimized homography for the specified template frame and current frame, with 1 in the lower right corner |
iterations | The number of optimization iterations that will be applied at most, with range [1, infinity) |
lambda | Initial Levenberg-Marquardt damping value which may be changed after each iteration using the damping factor, with range [0, infinity) |
lambdaFactor | Levenberg-Marquardt damping factor to be applied to the damping value, with range [1, infinity) |
initialError | Optional resulting initial averaged squared error between template and current frame within the sub-region |
finalError | Optional resulting final averaged squared error between template and current frame within the sub-region |
intermediateErrors | Optional resulting intermediate averaged squared errors, on error for each improving optimization iteration |
abort | Optional abort statement allowing to abort the alignment at any time; set the value True to abort the alignment |
externalConsistencyData | Optional abstract consistency data object that may be used to improve the overall performance for several successive optimization calls for individual current frames but with the same template frame |
|
static |
Optimizes the alignment between two images within a specified sub-region regarding a homography by applying a multi-resolution (coarse to fine approach) Gauss-Newton or a Levenberg-Marquardt optimization approach.
The resulting homography converts points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint), the given rough homography must be defined accordingly.
The performance of this function can be improved further if this function is invoked successively for the same template frame with identical parameters but with individual current frames.
In this case, an empty consistency data object must be provided for the first call, stored outside and must again be provided for the successive calls.
templateFramePyramid | The pyramid frame of the template frame |
templateSubRegions | The multi-resolution sub-regions defined in the template frames (one sub-region for each pyramid-layer) |
currentFramePyramid | The pyramid frame of the current frame, must have the same pixel format, pixel origin and layer number as the pyramid of the template frame |
layers | The number of pyramid layers to be used for the alignment, with range [1, min(templateFramePyramid.layers(), currentFramePyramid.layers()] |
homographyParameters | The number of parameters representing the homography with range [8, 9] |
additiveAlignment | True, to apply the additive delta optimization; False, to apply the inverse compositional delta optimization |
levenbergMarquardtOptimization | True, to apply the Levenberg-Marquardt optimization; False, to apply Gauss-Newton |
zeroMean | True, to apply a zero-mean optimization (color intensities will be subtracted from the mean color intensity); False, to use the color intensities directly |
roughHomography | The rough homography already known between the template frame and the current frame (currentPoint = H * templatePoint) |
homography | The resulting precise homography |
coarseIterations | The number of optimization iterations that will be applied at most on the coarsest pyramid layer, with range [1, infinity) |
fineIterations | The number of optimization iterations that will be applied at most on the finest pyramid layer, the layers between coarsest and finest layer will be handled by a linear interpolation between both iteration values, with range [1, infinity) |
consistencyDatas | The optional consistency data objects to improve the optimization performance, either no objects or one object per pyramid layer |
|
static |
Optimizes the alignment between two images within a specified sub-region regarding a homography by applying a multi-resolution (coarse to fine approach) Gauss-Newton or a Levenberg-Marquardt optimization approach.
The resulting homography converts points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint), the given rough homography must be defined accordingly.
The performance of this function can be improved further if this function is invoked successively for the same template frame with identical parameters but with individual current frames.
In this case, an empty consistency data object must be provided for the first call, stored outside and must again be provided for the successive calls.
templateFrame | The template frame, must be valid |
templateSubRegion | The sub-region defined in the template frames, must be valid |
currentFrame | The current frame, must have the same pixel format, pixel origin and layer number as the pyramid of the template frame, must be valid |
numberPyramidLayers | The number of pyramid layers to be used, with range [1, infinity) |
homographyParameters | The number of parameters representing the homography with range [8, 9] |
additiveAlignment | True, to apply the additive delta optimization; False, to apply the inverse compositional delta optimization |
levenbergMarquardtOptimization | True, to apply the Levenberg-Marquardt optimization; False, to apply Gauss-Newton |
zeroMean | True, to apply a zero-mean optimization (color intensities will be subtracted from the mean color intensity); False, to use the color intensities directly |
roughHomography | The rough homography already known between the template frame and the current frame (currentPoint = H * templatePoint) |
homography | The resulting precise homography |
coarseIterations | The number of optimization iterations that will be applied at most on the coarsest pyramid layer, with range [1, infinity) |
fineIterations | The number of optimization iterations that will be applied at most on the finest pyramid layer, the layers between coarsest and finest layer will be handled by a linear interpolation between both iteration values, with range [1, infinity) |
downsamplingMode | The down-sampling mode that is applied to create the pyramid layers |
|
staticprotected |
Determines the current error for a given homography between a current frame and a template frame within a sub-region of the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
We keep this implementation for debugging and for better understanding of the overall algorithm.
templateFrame | The template frame for which the error is determined, with 8 bit per pixel and 1-4 channels |
templateSubRegion | The sub-region defined within the template frame |
currentFrame | The current frame for which the error is determined, must have the same pixel format and pixel origin as the template frame |
homography | The homography for which the error is determined, transforming points defined in the template frame to points defined in the current frame, with 1 in the lower right corner |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
|
staticprotected |
Determines the current error for a given homography between a current frame and a template frame within a sub-region of the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
We keep this implementation for debugging and for better understanding of the overall algorithm.
templateFrame | The template frame for which the error is determined, with 8 bit per pixel and 1-4 channels |
templateSubRegion | The sub-region defined within the template frame |
currentFrame | The current frame for which the error is determined, must have the same pixel format and pixel origin as the template frame |
homography | The homography for which the error is determined, transforming points defined in the template frame to points defined in the current frame, with 1 in the lower right corner |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
tChannels | The number of channels both frames have, with range [1, 4] |
|
staticprotected |
Determines the 8x8 or 9x9 Hessian matrix and the 8x1 or 9x1 Jacobian-Error vector for a given homography between a current frame and a template frame within a sub-region of the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
We keep this implementation for debugging and for better understanding of the overall algorithm.
templateFrame | The template frame for which the Hessian and Jacobian is determined, with 8 bit per pixel and 1-4 channels |
templateSubRegion | The sub-region defined within the template frame |
currentFrame | The current frame for which the Hessian and Jacobian is determined, must have the same pixel format and pixel origin as the template frame |
homography | The homography for which the Hessian and Jacobian is determined, transforming points defined in the template frame to points defined in the current frame, with 1 in the lower right corner |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
hessian | The resulting Hessian matrix |
jacobianError | The resulting Jacobian-Error matrix |
tParameters | The number of parameters describing the homography and used to optimize it, with range [8, 9] |
|
staticprotected |
Determines the 8x8 or 9x9 Hessian matrix and the 8x1 or 9x1 Jacobian-Error vector for a given homography between a current frame and a template frame within a sub-region of the template frame.
The homography transformed points defined in the template frame to points defined in the current frame (currenttPoint = H * templatePoint).
We keep this implementation for debugging and for better understanding of the overall algorithm.
templateFrame | The template frame for which the Hessian and Jacobian is determined, with 8 bit per pixel and 1-4 channels |
templateSubRegion | The sub-region defined within the template frame |
currentFrame | The current frame for which the Hessian and Jacobian is determined, must have the same pixel format and pixel origin as the template frame |
homography | The homography for which the Hessian and Jacobian is determined, transforming points defined in the template frame to points defined in the current frame, with 1 in the lower right corner |
hessian | The resulting Hessian matrix |
zeroMean | True, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly |
jacobianError | The resulting Jacobian-Error matrix |
tParameters | The number of parameters describing the homography and used to optimize it, with range [8, 9] |
tChannels | The number of channels both frames have, with range [1, 4] |