Ocean
|
This class implements a tracker determining a similarity transformation between two successive video frames. More...
Public Types | |
enum | TrackerConfidence { TC_NONE , TC_BAD , TC_MODERATE , TC_GOOD , TC_VERY_GOOD } |
Definition of individual confidence values. More... | |
enum | RegionTextureness { RT_UNKNOWN , RT_LOW , RT_MODERATE , RT_HIGH } |
Definition of individual textureness qualities. More... | |
Public Member Functions | |
SimilarityTracker ()=default | |
Creates a new tracker object. More... | |
bool | determineSimilarity (const Frame &yFrame, const CV::PixelBoundingBox &previousSubRegion, SquareMatrix3 *currentTprevious=nullptr, Vector2 *translation=nullptr, Scalar *rotation=nullptr, Scalar *scale=nullptr, const Vector2 &predictedTranslation=Vector2(0, 0), TrackerConfidence *trackerConfidence=nullptr, RegionTextureness *regionTextureness=nullptr, Worker *worker=nullptr) |
Determines the similarity between two successive video frame within a specified sub-region. More... | |
const CV::FramePyramid & | currentFramePyramid () const |
Returns the frame pyramid of the most recent frame. More... | |
const CV::FramePyramid & | keyFramePyramid () const |
Returns the frame pyramid of one of the previous frames (the current key-frame). More... | |
void | reset () |
Resets the similarity tracker. More... | |
Static Public Member Functions | |
static float | combinedConfidence (const TrackerConfidence trackerConfidence, const RegionTextureness regionTextureness) |
Calculate an overall confidence values based on a tracker confidence and a region textureness. More... | |
Static Protected Member Functions | |
static bool | determineFeaturePoints (const CV::FramePyramid &yFramePyramid, const CV::PixelBoundingBox &subRegion, const size_t minimalFeaturePoints, const size_t desiredFeaturePoints, const size_t maximalFeaturePoints, Vectors2 &featurePoints, unsigned int &usedLayerIndex, RegionTextureness ®ionTextureness, Worker *worker=nullptr) |
Detects feature points in given frame for which a frame pyramid exists. More... | |
static bool | determineSimilarityTransformation (const CV::FramePyramid &yPreviousFramePyramid, const CV::FramePyramid &yCurrentFramePyramid, const Vectors2 &previousPoints, const Vectors2 &roughCurrentPoints, RandomGenerator &randomGenerator, SquareMatrix3 ¤tTprevious, Indices32 &validCorrespondences, const unsigned int coarsestLayerRadius, const unsigned int subPixelIterations, Worker *worker=nullptr) |
Determines the similarity transformation between two successive frames. More... | |
Protected Attributes | |
CV::FramePyramid | keyFramePyramid_ |
The frame pyramid of the key frame, one of the previous frames. More... | |
CV::FramePyramid | currentFramePyramid_ |
The frame pyramid of the current frame. More... | |
RandomGenerator | randomGenerator_ |
The random generator object. More... | |
SquareMatrix3 | previous_T_key_ = SquareMatrix3(true) |
The similarity since 'previousFramePyramid_' have been updated the last time, defined in the resolution of the usage pyramid layer. More... | |
Vectors2 | keyFramePoints_ |
The image points located in 'previousFramePyramid_', defined in the usage pyramid layer. More... | |
unsigned int | keyFramePointsLayerIndex_ = (unsigned int)(-1) |
The frame pyramid layer index in which 'keyFramePoints_' have been determined, -1 if invalid. More... | |
This class implements a tracker determining a similarity transformation between two successive video frames.
A similarity transformation has four degrees of freedom and contains a rotation, a scale, and a 2D translation (in x- and y- direction) within the image domain.
The 3x3 matrix representing the similarity transformation has the following layout:
| a -b tx | | b a ty | | 0 0 1 |
Definition of individual confidence values.
|
default |
Creates a new tracker object.
|
inlinestatic |
Calculate an overall confidence values based on a tracker confidence and a region textureness.
trackerConfidence | The confidence value of the tracker |
regionTextureness | The textureness of the sub-region in which the tracker was applied |
|
inline |
Returns the frame pyramid of the most recent frame.
|
staticprotected |
Detects feature points in given frame for which a frame pyramid exists.
The points may be determined in a lower image resolution if enough features can be found.
yFramePyramid | The frame pyramid of the frame in which the feature points will be determined, with pixel format FORMAT_Y8, must be valid with at least one layer |
subRegion | The sub-region inside the frame in which feature points will be determined, specified in the domain of the finest image resolution, must be valid |
minimalFeaturePoints | The minimal number of feature points that must be detected so that the function succeeds, with range [1, infinity) |
desiredFeaturePoints | The desired number of feature points that should be detected in an ideal case, with range [minimalFeaturePoints, infinity) |
maximalFeaturePoints | The maximal number of feature points that will be detected, with range [desiredFeaturePoints, infinity) |
featurePoints | The resulting detected feature points, defined in the domain of the pyramid layer as returned by 'usedLayerIndex' |
usedLayerIndex | The pyramid layer in which the resulting feature points have been detected, with range [0, framePyramid.layers() - 1] |
regionTextureness | The resulting textureness of the sub-region (which is based on the numbers of found feature etc.) |
worker | Optional worker object to distribute the computation |
bool Ocean::Tracking::Point::SimilarityTracker::determineSimilarity | ( | const Frame & | yFrame, |
const CV::PixelBoundingBox & | previousSubRegion, | ||
SquareMatrix3 * | currentTprevious = nullptr , |
||
Vector2 * | translation = nullptr , |
||
Scalar * | rotation = nullptr , |
||
Scalar * | scale = nullptr , |
||
const Vector2 & | predictedTranslation = Vector2(0, 0) , |
||
TrackerConfidence * | trackerConfidence = nullptr , |
||
RegionTextureness * | regionTextureness = nullptr , |
||
Worker * | worker = nullptr |
||
) |
Determines the similarity between two successive video frame within a specified sub-region.
yFrame | The 8bit grayscale frame for which the similarity (in relation to the previous frame) will be determined, with image dimension [40, infinity)x[40, infinity) must be valid |
previousSubRegion | The sub-region (in the previous frame) in which feature points will be determined and tracked to from the previous frame to the current frame, must be valid, must not lie outside the frame |
currentTprevious | Optional resulting 3x3 matrix containing the entire similarity transformation: currentPoint = similarity * previousPoint |
translation | Optional resulting translation between the current and the previous video frame, in pixel, with range (-infinity, infinity)x(-infinity, infinity) |
rotation | Optional resulting rotation between the current and the previous video frame, in radian, with range [-PI, PI] |
scale | Optional resulting scale between the current and the previous video frame, with range (0, infinity) |
predictedTranslation | The predicted translation between the previous frame and the current frame if known, may be based on e.g., a gyro motion |
trackerConfidence | Optional resulting confidence value of the tracker |
regionTextureness | Optional resulting textureness of the provided sub-region |
worker | Optional worker object to distribute the computation |
trackerConfidence
to check whether the resulting tracking data is valid
|
staticprotected |
Determines the similarity transformation between two successive frames.
yPreviousFramePyramid | The frame pyramid of the previous frame in which the given 'previousPoints' are located, with pixel format FORMAT_Y8, must be valid with at least one layer |
yCurrentFramePyramid | The frame pyramid of the current frame to which the previous points will be tracked, must have the same format and layout as 'yPreviousFramePyramid' |
previousPoints | The previous feature points defined within the domain of the finest pyramid layer of 'yPreviousFramePyramid', at least one |
roughCurrentPoints | Optional the already known rough locations of the previous points with the current frame, one for each previous point, otherwise an empty vector |
randomGenerator | The object to be used to generate random numbers |
currentTprevious | The resulting similarity transformation matching with the resolution of f the finest pyramid layer, transforming points defined in the previous frame to points in the current frame: (currentPoint = currentTprevious * previousPoint) |
validCorrespondences | The resulting indices of all previous feature points that have been used for determination of the similarity transformation |
coarsestLayerRadius | The search radius on the coarsest layer in pixel, with range [2, infinity) |
subPixelIterations | Number of sub-pixel iterations that will be applied, each iteration doubles the sub-pixel accuracy, with range [1, infinity) |
worker | Optional worker object to distribute the computation |
|
inline |
Returns the frame pyramid of one of the previous frames (the current key-frame).
|
inline |
Resets the similarity tracker.
|
protected |
The frame pyramid of the current frame.
|
protected |
The image points located in 'previousFramePyramid_', defined in the usage pyramid layer.
|
protected |
The frame pyramid layer index in which 'keyFramePoints_' have been determined, -1 if invalid.
|
protected |
The frame pyramid of the key frame, one of the previous frames.
|
protected |
The similarity since 'previousFramePyramid_' have been updated the last time, defined in the resolution of the usage pyramid layer.
|
protected |
The random generator object.