Adding files to the project
For this chapter, we need to add just one new class, com.nummist.secondsight.filters.ar.ImageDetectionFilter
. We also need to add some resource files, that is, the images that we want to track. Download the images from http://nummist.com/opencv/5206_04_images.zip, unzip them, and put them in the project's res/drawable-nodpi
folder.
These images are famous paintings by a Dutch artist named Vincent van Gogh and an Indian artist named Basawan. Our tracker will work well with these images because they contain many high-contrast details, without much repetition of patterns. Thus, there is something distinctive to track in most of the parts of each image. For example, here is one of Basawan's paintings, Akbar Hunting with Cheetahs:
And here is one of Van Gogh's paintings, The Starry Night: