In <a href="http://sandbox.arrayfire.com/computer-vision-arrayfire-part-1/">Computer Vision in ArrayFire - Part 1</a> we talked about Feature Detection. To complement the previous post, we now share some of the preliminary results Feature Description with ORB [1], along with the results for Matching these descriptors.

The hardware and software used are the same used in Part 1:
<ul>
	<li>Intel Sandy Bridge Xeon processor with 32 cores (for OpenCV CPU implementation)</li>
	<li>NVIDIA Tesla K20C (for OpenCV and ArrayFire CUDA implementations)</li>
	<li>ArrayFire development version</li>
	<li>OpenCV version 2.4.9</li>
</ul>

<h3>Feature Description and Matching Benchmarks</h3>

In Part 1 we have shown that feature detection with FAST [2] scales according to the number of features detected. Different from FAST, the ORB descriptor extractor scales according to the number of pixels of the input image, even though it relies on FAST to detect features (note that the benchmarks for feature description also includes the process of feature detection).

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

The Hamming matcher benchmarks are shown below. To perform these measurements, we used a set of 500 descriptors as test descriptors (e.g., number of descriptors extracted from an image), being matched to a database containing 500 to 5 million descriptors, separated by a factor of 10.

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

<h3>Descriptor Matching Samples</h3>

In this section we show two image samples, matching Lena's picture against itself but rotated 90 degrees counterclockwise, one using ArrayFire (top) and the other using OpenCV (bottom). There is also a green rectangle around the matched pictures, that indicated the homography of the detected object.

<a href="http://sandbox.arrayfire.com/wp-content/uploads/2014/07/orb_lena_arrayfire.png"><img src="http://sandbox.arrayfire.com/wp-content/uploads/2014/07/orb_lena_arrayfire.png" alt="ArrayFIre ORB" width="1024" height="512" class="alignnone size-full wp-image-6194" /></a>

<a href="http://sandbox.arrayfire.com/wp-content/uploads/2014/07/orb_lena_opencv.png"><img src="http://sandbox.arrayfire.com/wp-content/uploads/2014/07/orb_lena_opencv.png" alt="OpenCV ORB" width="1024" height="512" class="alignnone size-full wp-image-6195" /></a>

<h3>Discussion</h3>

We see that there is a clear advantage using GPUs over CPUs when it comes to processing time, as stated before in Part 1. By using GPUs, it is possible to do descriptor extraction more than <strong>20 times</strong> faster than with a CPU. Similarly, we can achieve average speedup of about <strong>25 times</strong> for descriptor matching using hamming distance.

As said in the beginning of this post, these are preliminary values, there is still more to be done and more improvements on performance might be achieved until the new version of ArrayFire is released.

<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.