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

The results we show in this blog use the same hardware and software used in the previous blog:
<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 showed that feature detection with FAST [2] scales with respect to to the number of features detected. While ORB use FAST, in practice the ORB descriptor extractor scales based on the pixel count of the input image. The increase in the computational requirements is not due to FAST, but rather due to the additional algorithms that ORB uses.

&nbsp;

<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 an image matching of the Lena image with a 90 degrees rotation of Lena. The top set uses ArrayFire and the bottom set uses OpenCV. 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 class="alignnone size-full wp-image-6194" src="http://sandbox.arrayfire.com/wp-content/uploads/2014/07/orb_lena_arrayfire.png" alt="ArrayFIre ORB" width="1024" height="512" /></a>

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