O'Reilly logo

Android Application Programming with OpenCV 3 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

Porting the ARFilter to C++

We will port the ImageDetectionFilter class to C++. However, for the sake of limiting this project's scope, we will leave CameraProjectionAdapter and ARCubeRenderer as pure Java classes.

Once again, let's start with a header file, ImageDetectionFilter.hpp. This header uses types from OpenCV's core and features2d modules, plus the Standard Template Library's std::vector class. (The latter class is analogous to Java's ArrayList.) Accordingly, we can begin the header with the following code:

#ifndef IMAGE_DETECTION_FILTER
#define IMAGE_DETECTION_FILTER

#include <vector>

#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>

namespace secondsight {

The C++ version of ImageDetectionFilter has the same ...

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