Package boofcv.alg.tracker.klt
Class PyramidKltTracker<InputImage extends ImageGray<InputImage>,DerivativeImage extends ImageGray<DerivativeImage>>
java.lang.Object
boofcv.alg.tracker.klt.PyramidKltTracker<InputImage,DerivativeImage>
public class PyramidKltTracker<InputImage extends ImageGray<InputImage>,DerivativeImage extends ImageGray<DerivativeImage>>
extends Object
A pyramid Kanade-Lucas-Tomasi (KLT) tracker that allows features to be tracker over a larger region than the basic
(KltTracker
) implementation. A feature is tracked at multiple resolutions, large motions can
be detected at low resolution and are refined at higher resolutions.
Tracking is allowed along the image border. A track is dropped if the smallest track is outside the image.
-
Field Summary
Modifier and TypeFieldDescriptionprotected @Nullable DerivativeImage[]
protected @Nullable DerivativeImage[]
protected ImagePyramid<InputImage>
protected KltTracker<InputImage,
DerivativeImage> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a copy which can be run in parallel.float
getError()
Average error between track template and the image.boolean
setDescription
(PyramidKltFeature feature) Sets the feature's description up.void
setImage
(ImagePyramid<InputImage> image) Only sets the image pyramid.void
setImage
(ImagePyramid<InputImage> image, DerivativeImage[] derivX, DerivativeImage[] derivY) Sets the current input images for the tracker to use.track
(PyramidKltFeature feature) Finds the feature's new location in the image.
-
Field Details
-
tracker
protected KltTracker<InputImage extends ImageGray<InputImage>,DerivativeImage extends ImageGray<DerivativeImage>> tracker -
image
-
derivX
-
derivY
-
-
Constructor Details
-
PyramidKltTracker
-
-
Method Details
-
setImage
public void setImage(ImagePyramid<InputImage> image, DerivativeImage[] derivX, DerivativeImage[] derivY) Sets the current input images for the tracker to use.- Parameters:
image
- Original image pyramid.derivX
- Derivative along x-axis.derivY
- Derivative along y-axis.
-
setImage
Only sets the image pyramid. The derivatives are set to null. Only use this when tracking.- Parameters:
image
- Image pyramid
-
setDescription
Sets the feature's description up. The feature's (x,y) must have already been set andsetImage(boofcv.struct.pyramid.ImagePyramid<InputImage>, DerivativeImage[], DerivativeImage[])
been called.- Parameters:
feature
- Feature's whose description is being setup.- Returns:
- true if there was sufficient information to create a feature or false if not
-
track
Finds the feature's new location in the image. The feature's position can be modified even if tracking fails.
NOTE: The feature's description is not updated and tracking over several frames can break down if its description is not updated.
- Parameters:
feature
- The feature being tracked.- Returns:
- If tracking failed or not.
-
getError
public float getError()Average error between track template and the image.- Returns:
- error
- See Also:
-
boofcv.alg.tracker.klt.KltTracker#getError()
-
copyConcurrent
Creates a copy which can be run in parallel. Data structures which can be shared are shared.
-