Class KltTracker<InputImage extends ImageGray,DerivativeImage extends ImageGray>
- java.lang.Object
-
- boofcv.alg.tracker.klt.KltTracker<InputImage,DerivativeImage>
-
public class KltTracker<InputImage extends ImageGray,DerivativeImage extends ImageGray> extends java.lang.ObjectA Kanade-Lucas-Tomasi (KLT) [1,2,3,4] point feature tracker for a single layer gray scale image. It tracks point features across a sequence of images by having each feature individually follow the image's gradient. Feature locations are estimated to within sub-pixel accuracy.
For this particular implementation of KLT, image derivatives is only needed when setDescription() is called. Tracker quality will degrade if features change orientation, but this technique is significantly faster.
Citations:
[1] Bruce D. Lucas and Takeo Kanade. An Iterative Image Registration Technique with an Application to Stereo Vision. International Joint Conference on Artificial Intelligence, pages 674-679, 1981.
[2] Carlo Tomasi and Takeo Kanade. Detection and Tracking of Point Features. Carnegie Mellon University Technical Report CMU-CS-91-132, April 1991.
[3] Jianbo Shi and Carlo Tomasi. Good Features to Track. IEEE Conference on Computer Vision and Pattern Recognition, pages 593-600, 1994.
[4] Stan Birchfield, http://www.ces.clemson.edu/~stb/klt/
-
-
Constructor Summary
Constructors Constructor and Description KltTracker(InterpolateRectangle<InputImage> interpInput, InterpolateRectangle<DerivativeImage> interpDeriv, KltConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description KltConfiggetConfig()floatgetError()Average absolute value of the difference between each pixel in the image and the templatebooleanisDescriptionComplete(KltFeature feature)Checks to see if the feature description is complete or if it was created by a feature partially outside the imagebooleanisFullyInside(float x, float y)Returns true if the features is entirely enclosed inside of the image.booleanisFullyOutside(float x, float y)Returns true if the features is entirely outside of the image.booleansetDescription(KltFeature feature)Sets the features description using the current image and the location of the feature stored in the feature.voidsetImage(InputImage image, DerivativeImage derivX, DerivativeImage derivY)Sets the current image it should be tracking with.KltTrackFaulttrack(KltFeature feature)Updates the feature's location inside the image.voidunsafe_setImage(InputImage image, DerivativeImage derivX, DerivativeImage derivY)Same assetImage(InputImage, DerivativeImage, DerivativeImage), but it doesn't check to see if the images are the same size each time
-
-
-
Constructor Detail
-
KltTracker
public KltTracker(InterpolateRectangle<InputImage> interpInput, InterpolateRectangle<DerivativeImage> interpDeriv, KltConfig config)
-
-
Method Detail
-
setImage
public void setImage(InputImage image, DerivativeImage derivX, DerivativeImage derivY)
Sets the current image it should be tracking with.- Parameters:
image- Original input image.derivX- Image derivative along the x-axisderivY- Image derivative along the y-axis
-
unsafe_setImage
public void unsafe_setImage(InputImage image, DerivativeImage derivX, DerivativeImage derivY)
Same assetImage(InputImage, DerivativeImage, DerivativeImage), but it doesn't check to see if the images are the same size each time
-
setDescription
public boolean setDescription(KltFeature feature)
Sets the features description using the current image and the location of the feature stored in the feature. If the feature is an illegal location and cannot be set then false is returned.- Parameters:
feature- Feature description which is to be set. Location must be specified.- Returns:
- true if the feature's description was modified.
-
track
public KltTrackFault track(KltFeature feature)
Updates the feature's location inside the image. The feature's position can be modified even if tracking fails.
- Parameters:
feature- Feature being tracked.- Returns:
- If the tracking was successful or not.
-
isDescriptionComplete
public boolean isDescriptionComplete(KltFeature feature)
Checks to see if the feature description is complete or if it was created by a feature partially outside the image
-
isFullyInside
public boolean isFullyInside(float x, float y)Returns true if the features is entirely enclosed inside of the image.
-
isFullyOutside
public boolean isFullyOutside(float x, float y)Returns true if the features is entirely outside of the image. A region is entirely outside if not an entire pixel is contained inside the image. So if only 0.999 of a pixel is inside then the whole region is considered to be outside. Can't interpolate nothing...
-
getError
public float getError()
Average absolute value of the difference between each pixel in the image and the template- Returns:
- Average error
-
getConfig
public KltConfig getConfig()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG