A few weeks ago we wrote Writing a Simple Corner Detector with ArrayFire. In that post, we discussed 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.
For the next release, ArrayFire will have a complete set to start with feature tracking, including FAST for feature detection , ORB for description  and a Hamming distance matcher. We will also include a dedicated version of the Harris corner detector , even though it can be written using existing ArrayFire functions. This implementation is straightforward, easy to use and will have better performance.
For this post, we will share some of our current benchmarks for Harris corner detector and FAST feature detector. We compare the performance of our implementation of these functions against the same functions in OpenCV, which is currently one of the best code references for computer vision.
The results shown below were all generated with an Intel Sandy Bridge Xeon processor with 32 cores for OpenCV CPU implementation and an NVIDIA Tesla K20C GPU for OpenCV CUDA and ArrayFire CUDA implementations.
Software used for benchmarking included ArrayFire development version and OpenCV 2.4.9 with SSE and CUDA support.
Feature Detection Benchmarks
We first start with some benchmarks of the Harris corner detector. The run times for OpenCV’s CUDA implementation at larger sizes are not included because it runs out of memory at larger image sizes. Note that the horizontal axes of all graphs are in logarithmic scale.
The following graphs depict the speedup of ArrayFire CUDA and OpenCV CUDA implementations over OpenCV CPU implementation.
The horizontal axis for Harris detector is the number of pixels, while that of FAST detector is number of features detected. This was done because the Harris score is calculated for all the pixels before eliminating the pixels whose score falls below a certain threshold. The score for FAST features are detected by progressively eliminating pixels that do not fit various criteria. The FAST scores are only calculated once the features have been detected. This results in the time taken for Harris to scale with the number of pixels, while the times taken for FAST scales with the number of features detected.
Feature Detection Samples
In this section, we show the images with the detected features plotted on them for both ArrayFire and OpenCV. There are many variables that influence the results, including among others, rounding and empirically defined constants. For these reasons, 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 provide features that are very similar.
The following set of images include samples for the Harris corner detector with ArrayFire, immediately followed by OpenCV.
The following images show the similarities in the FAST implementations, first with ArrayFire followed by OpenCV.
By looking at the previous graphs, the advantage of using GPUs for computer vision applications over CPUs is made very clear. For the Harris detector, ArrayFire is at least 16 times faster than the CPU implementation. For the FAST feature detector, ArrayFire is 3-5 times faster for a smaller number of features, but is 8-10 times faster when the number of features requested is higher.
Comparing OpenCV’s CUDA implementation, we see that in almost all cases we are already at least as good as better. For Harris detector, ArrayFire is 4 times faster than OpenCV’s GPU implementation at smaller sizes before evening out. At larger sizes OpenCV CUDA implementation runs out of GPU memory and fails to detect any features.
For FAST, ArrayFire is up to 3 times faster than OpenCV’s CUDA implementation. ArrayFire is consistently at least 2 times faster and is slower for only one image.
However, this is not yet the final version, we are still working on improving performance. We can assure that these numbers will be even more impressive when we release these algorithms to the public.
If you can not wait until the release and want to get a taste of what is coming, please, contact us at firstname.lastname@example.org, 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 set of computer vision functions.
References Rosten, Edward, and Tom Drummond. “Machine learning for high-speed corner detection.” Computer Vision–ECCV 2006. Springer Berlin Heidelberg, 2006. 430-443.
 Rublee, Ethan, et al. “ORB: an efficient alternative to SIFT or SURF.” Computer Vision (ICCV), 2011 IEEE International Conference on. IEEE, 2011.
 Harris, Chris, and Mike Stephens. “A combined corner and edge detector.” Alvey vision conference. Vol. 15. 1988.