O'Reilly logo

Android Application Programming with OpenCV by Joseph Howse

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing an image tracking filter

We will write our tracker as an implementation of the Filter interface, which we created in the previous chapter. The tracker's class name will be ImageDetectionFilter. As member variables, this class has instances of FeatureDetector, DescriptorExtractor, and DescriptorMatcher, as well as several Mat instances that store image data and intermediate or final results of tracking calculations. Some of these results are stored because they do not change from frame to frame. Others are stored simply because it is more efficient than recreating the Mat instance for each frame. The declarations of the class and member variables are as follows:

public class ImageDetectionFilter implements Filter { private final Mat mReferenceImage; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required