A few weeks ago we posted <a href="http://sandbox.arrayfire.com/creating-a-simple-corner-detector-with-arrayfire/">Writing a Simple Corner Detector with ArrayFire</a>, talking a little bit about the new features that we are working on for ArrayFire. Some of these new computer vision features will be available in the next release of ArrayFire, which will be out in just a few months.

For the next release, ArrayFire will have a complete set to start with feature tracking, including FAST for feature detection [1], ORB for description [2] and a Hamming distance matcher. We will also include a dedicated version of the Harris corner detector [3], even knowing we can fully write it using core ArrayFire functions, this implementation will be more straightforward and simpler to use, combined with a better performance.

For this post, we will share some of our current benchmarks for this new set of features. We compare the results of each of these functions to the OpenCV implementations, which is currently one of the best code references for computer vision.

The results shown below were all generated with an Intel Sandy Bridge 32 core processor and an NVIDIA Tesla K20C GPU. Software used is ArrayFire development version and OpenCV 2.4.9 with SSE and CUDA support.

<h3>Feature Detection Benchmarks</h3>

We first start with some benchmarks of the Harris corner detector. Its graph is shown below. Note that the horizontal axes of all graphs are in logarithmic scale.

<iframe height=371 width=600 src="//docs.google.com/a/sandbox.arrayfire.com/spreadsheets/d/1OqbdY8B8K7z6_trW2qB1lseDREGzVe7V1OJKsPnmUC4/gviz/chartiframe?oid=1713785027" seamless frameborder=0 scrolling=no></iframe>

The Harris detector scales with the number of pixels of an image, this is due to the score calculation being done before the elimination. However, FAST is a different situation, its score is only computed after elimination, only if a feature is indeed detected. Its graph, in accordance to the number of features can be seen below.

<iframe height=371 width=600 src="//docs.google.com/a/sandbox.arrayfire.com/spreadsheets/d/1OqbdY8B8K7z6_trW2qB1lseDREGzVe7V1OJKsPnmUC4/gviz/chartiframe?oid=1883059785" seamless frameborder=0 scrolling=no></iframe>

<h3>Feature Detection Samples</h3>

Here we show the detected features for both Harris and FAST, comparing ArrayFire implementation to OpenCV's. Numerous are the variables that influence the results, including rounding, empirically defined constants, and so on, because of this, we can not expect two implementations to be perfectly equal to each other.

Even though ArrayFire and OpenCV implementations do not give the exact same results, they are very similar, being difficult even to identify such differences (except for the colors different colors in matching features). Below we include samples 

<a href="http://sandbox.arrayfire.com/wp-content/uploads/2014/06/harris_arrayfire.png"><img src="http://sandbox.arrayfire.com/wp-content/uploads/2014/06/harris_arrayfire.png" alt="ArrayFire Harris" width="512" height="512" class="alignnone size-full wp-image-5886" /></a>
<a href="http://sandbox.arrayfire.com/wp-content/uploads/2014/06/harris_opencv.png"><img src="http://sandbox.arrayfire.com/wp-content/uploads/2014/06/harris_opencv.png" alt="OpenCV Harris" width="512" height="512" class="alignnone size-full wp-image-5887" /></a>

<h3>Discussion</h3>

By looking at the previous graphs, the advantage of using GPUs for computer vision applications over CPUs is made very clear, as we can get speedups of more than 10 times for the FAST features detector.

Comparing OpenCV's CUDA implementation, we see that in almost all cases we are already at least faster, but this is not the case for all samples. However, this is not yet the final version, we still have a lot of work to improve performance even more and to have everything working perfectly, with the same quality we always provide in each and every release. With this in mind, we can assure that these numbers will improve even more until these algorithm are made public.

If you can not wait until the release and want to get a taste of what is coming, please, contact us at <a href="mailto:sales@arrayfire.com">sales@arrayfire.com</a>, we will be happy to discuss on how you can get the latest features of ArrayFire before the release!

Stay tuned for the upcoming news on our new computer vision set of tools.

<h3>References</h3>

[1] Rosten, Edward, and Tom Drummond. "Machine learning for high-speed corner detection." Computer Vision–ECCV 2006. Springer Berlin Heidelberg, 2006. 430-443.
[2] Rublee, Ethan, et al. "ORB: an efficient alternative to SIFT or SURF." Computer Vision (ICCV), 2011 IEEE International Conference on. IEEE, 2011.
[3] Harris, Chris, and Mike Stephens. "A combined corner and edge detector." Alvey vision conference. Vol. 15. 1988.