This class implements a homography tracker able to determine a homography in real-time.
More...
This class implements a homography tracker able to determine a homography in real-time.
The tracker stores the two frame pyramids, one pyramid for the previous frame, one pyramid of the current frame.
For each new camera frame a group of reliable/strong feature points visible in the previous camera frame will be tracked to the new camera frame.
The point correspondences will be used to calculate the homography.
In contrast to HomographyImageAlignmentSparse the HomographyTracker uses explicitly provided image points for the determination of the homography while the HomographyImageAlignmentSparse selects suitable sparse information on its own.
- See also
- HomographyImageAlignmentSparse.
◆ HomographyTracker() [1/2]
Ocean::Tracking::HomographyTracker::HomographyTracker |
( |
| ) |
|
|
inlinedefault |
Creates a new homography tracker object and uses 31 as patch size.
◆ HomographyTracker() [2/2]
Ocean::Tracking::HomographyTracker::HomographyTracker |
( |
const unsigned int |
patchSize | ) |
|
|
inlineexplicit |
Creates a new homography tracker object and uses 31 as patch size.
- Parameters
-
patchSize | The size of the patches, possible values can be [5, 7, 15, 31]. |
◆ clear()
void Ocean::Tracking::HomographyTracker::clear |
( |
| ) |
|
|
inline |
Clears the previous pyramid frame of this tracking object.
◆ patchSize()
unsigned int Ocean::Tracking::HomographyTracker::patchSize |
( |
| ) |
const |
|
inline |
Returns the size of the patches which are used for tracking.
- Returns
- The patch size currently used, 31 by default
◆ setPatchSize()
void Ocean::Tracking::HomographyTracker::setPatchSize |
( |
const unsigned int |
size | ) |
|
|
inline |
Sets or changes the size of the patches which are used for tracking.
- Parameters
-
size | The size of the patches, possible values can be [5, 7, 15, 31]. |
◆ trackPoints() [1/2]
Tracks a group of given image points from the previous frame to the current frame and determines the corresponding homography afterwards.
In the case this function is invoked for the first time, the current frame is stored for the next function call (as previous frame) and the identity homography is returned.
The resulting homography will transform points defined in the previous frame to points defined in the current frame (pointCurrent = H * pointPrevious).
- Parameters
-
currentFrame | The current frame with pixel format as desired, must be valid |
yPreviousFrame | The previous frame as grayscale frame with pixel format FORMAT_Y8, with same frame dimension and pixel origin as the current frame, can be invalid if this function is invoked for the first time |
randomGenerator | Random number generator object |
previousPositions | Image points (e.g., string feature points) located in the previous image that will be used for the determination of the homography, may be empty if this function is invoked for the first time |
homography | The resulting homography |
worker | Optional worker object to distribute the computation |
frameBorder | The size of the area around the frame's border defining a region from which image points will not be used for tracking, with range [0, min(width, height) / 4) |
- Returns
- True, if a valid homography could be determined
◆ trackPoints() [2/2]
Tracks a group of given image points from the previous frame to the current frame and determines the corresponding homography afterwards.
The resulting homography will transform points defined in the previous frame to points defined in the current frame (pointCurrent = H * pointPrevious).
- Parameters
-
yPreviousFrame | The previous frame as grayscale frame, with same frame dimension and pixel origin as the previous/current frame, must have pixel format FORMAT_Y8, must be valid |
previousFramePyramid | The frame pyramid of the previous frame, must be valid |
currentFramePyramid | The frame pyramid of the current frame, with same frame type and layer number as 'previousFramePyramid' |
randomGenerator | Random number generator object |
previousPositions | Image points (e.g., string feature points) located in the previous image that will be used for the determination of the homography |
homography | Resulting homography |
worker | Optional worker object to distribute the computation |
patchSize | The size of the patches used for tracking, possible values can be [5, 7, 15, 31] |
- Returns
- True, if succeeded
◆ transformPoints()
Transforms a given set of points to a new set using a given transformation.
This function will calculate result[i] = transformation * points[i].
- Parameters
-
points | The points to be transformed |
transformation | The transformation to be used, must be valid |
- Returns
- Resulting transformed points
◆ currentFramePyramid_
Frame pyramid of the current frame.
◆ patchSize_
unsigned int Ocean::Tracking::HomographyTracker::patchSize_ = 31u |
|
private |
The size of the image patches used for tracking, possible values can be [5, 7, 15, 31].
◆ previousFramePyramid_
Frame pyramid of the previous frame.
The documentation for this class was generated from the following file: