Ocean
Ocean::Tracking::HomographyImageAlignmentSparse Class Reference

This class implements image alignment functions internally using sparse image information like e.g., feature points. More...

Static Public Member Functions

static bool determineHomographyWithPoints (const Frame &previousFrame, const CV::FramePyramid &previousFramePyramid, const CV::FramePyramid &currentFramePyramid, const CV::SubRegion &previousSubRegion, const size_t numberFeaturePoints, const unsigned int patchSize, const unsigned int coarsestLayerRadius, const bool determineFullHomography, const unsigned int subPixelIterations, SquareMatrix3 &homography, Worker *worker=nullptr, Vectors2 *previousPoints=nullptr, Vectors2 *currentPoints=nullptr, Indices32 *validPointIndices=nullptr, const Scalar squarePixelErrorThreshold=Scalar(3 *3), const bool zeroMean=true)
 Determines the global homography between two successive frames by applying a tracking of sparse feature points. More...
 

Detailed Description

This class implements image alignment functions internally using sparse image information like e.g., feature points.

See also
HomographyTracker.

Member Function Documentation

◆ determineHomographyWithPoints()

static bool Ocean::Tracking::HomographyImageAlignmentSparse::determineHomographyWithPoints ( const Frame previousFrame,
const CV::FramePyramid previousFramePyramid,
const CV::FramePyramid currentFramePyramid,
const CV::SubRegion previousSubRegion,
const size_t  numberFeaturePoints,
const unsigned int  patchSize,
const unsigned int  coarsestLayerRadius,
const bool  determineFullHomography,
const unsigned int  subPixelIterations,
SquareMatrix3 homography,
Worker worker = nullptr,
Vectors2 previousPoints = nullptr,
Vectors2 currentPoints = nullptr,
Indices32 validPointIndices = nullptr,
const Scalar  squarePixelErrorThreshold = Scalar(3 *3),
const bool  zeroMean = true 
)
static

Determines the global homography between two successive frames by applying a tracking of sparse feature points.

The function tries to track sparse feature points scattered over the entire image (or sub-region) by detecting even quite weak feature points.
The resulting homography transforms image points defined in the previous image to image points defined in the current image (currentPoint = H * previousPoint).
Additionally, this function can return all point correspondences that have been determined between both frames,
or only those point correspondences that have been verified by a homography-based RANSAC.
Beware: Provide a valid 'validPointIndices' parameter and you will receive any point correspondences (stored in 'previousPoints' and 'currentPoints').
Instead, setting the 'validPointIndices' parameter to nullptr will return RANSAC-verified point correspondences only (stored in 'previousPoints' and 'currentPoints').
Ensure that 'previousPoints' and 'currentPoints' are defined if 'validPointIndices' is defined.

Parameters
previousFrameThe previous frame which is used to determine the feature points, should have 8 bit grayscale pixel format to improve the performance, otherwise it will be converted internally, can be previousFramePyramid.finestLayer()
previousFramePyramidThe pyramid of the previous frame, all pyramid layers will be used for tracking, with same pixel origin as 'previousFrame'
currentFramePyramidThe pyramid of the current frame, with same pixel format, pixel original and layer number as 'previousFramePyramid'
previousSubRegionThe sub-region specified in the previous frame, image content outside this sub-region will not be used for tracking, define an invalid sub-region to use the entire image information
numberFeaturePointsThe number of feature points to be used, with range [1, infinity)
patchSizeThe size of the image patches used for point tracking, possible values are 5, 7, 15, 31
coarsestLayerRadiusThe search radius on the coarsest pyramid layer in pixel, with range [1, infinity)
determineFullHomographyTrue, to determine an 8-DOF homography; False, to determine a 2-DOF translational homography
subPixelIterationsNumber of sub-pixel iterations that will be applied, each iteration doubles the sub-pixel accuracy, 1 = 0.5, 2 = 0.25, 3 = 0.125, ..., with range [1, infinity)
homographyResulting homography transforming points in the previous image to points in the current image (currentPoint = H * previousPoint)
workerOptional worker object to distribute the computation
previousPointsOptional resulting image points located in the previous frame that have been either tracked and/or used for homography determination, the behavior depends whether 'validPointIndices' is defined or not, nullptr otherwise
currentPointsOptional resulting image points located in the current frame that have been either tracked and/or used for homograph determination, one for each point in the previous frame, nullptr otherwise
validPointIndicesOptional resulting indices of all point correspondences that have been verified by a homography-based RANSAC, nullptr otherwise
squarePixelErrorThresholdMaximal square pixel error between a right point and a transformed left point so that a point correspondence counts as valid, with range (0, infinity)
zeroMeanTrue, to subtract the color intensities from the corresponding mean intensity before determining the error; False, to determine the error directly
Returns
True, if succeeded
See also
Subset::subset(), Subset::indices2statements().*
Subset::subset(), Subset::indices2statements().

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