OpenCV-CL: Computer vision with OpenCL acceleration
Hi everyone, I’m writing to tell you about some exciting developments unfolding in the world of computer vision this year! With the latest releases of OpenCV (the world’s most popular computer vision library), your computer vision applications can now tap into the full power of modern heterogeneous computing platforms by utilizing both the CPU and the GPU.
Starting with OpenCV version 2.4.3, with major improvements on OpenCV 2.4.4, and continuous development planned for the future, there is now robust OpenCL support in OpenCV. OpenCV-CL is becoming a robust and efficient computer vision option that works great on AMD APUs and discrete GPUs.
Some of the OpenCV features that have been ported to OpenCL (including those targeted for the upcoming OpenCV 2.4.6 release) include:
• OpenCV-CL binary download,
• Initialization & information,
• Per-element operations,
• Image transforms,
• Color conversions,
• Rich filter engine, with a wide range of image filters, including high quality image enhancement,
• Geometrical image transforms,
• Mean shift-based transforms, K-means clustering,
• Corner detectors,
• Template matching,
• Descriptor matching,
• Feature detection, Haar, GoodFeaturesToTrack
• Feature descriptors
• Speeded Up Robust Features (SURF)
• Histograms of oriented gradients (HOG)
• Face detection (Viola Jones)
• Optical flow (LK, TV L1, Farneback)
• Stereo correspondence: BM, BP, CSBP
• SuperResolution, based on TV L1 optical flow
For the benefit of our developers, we have included two OpenCV-CL samples to our newest AMD APP SDK (version 2.8.1). A “hello world” sample verifies you have OpenCV-CL working in your system, and an interoperability sample shows how you can extend openCV-CL with your own OpenCL kernels with no OpenCL plumbing required! Here is how this works:
OpenCV-CL can expose as much or as little OpenCL as you, the programmer, desires. Developers with little or no OpenCL experience can just call the supported OpenCL functionality of the cv::ocl module, without needing to understand or write a single line of OpenCL API or OpenCL kernel code (while still enjoying the GPU performance kick on both integrated APUs and discrete GPUs). In fact, you can learn how to use OpenCL in computer vision applications, by “studying” the OpenCL implementation in the cv::ocl module. But for power users, we have a surprise: you can use OpenCV-CL infrastructure to get OpenCL enablement for free (with exactly one line of code). You can then plug your own custom kernels into the OpenCV-CL framework, thus extending the framework without even recompiling. AMD APP SDK 2.8.1 features an example of this OpenCV – OpenCL interop, demonstrating just how easy it is.
Last but not least, if you need help compiling OpenCV with OpenCL, just follow this link for step by step instructions on how to configure cmake to build OpenCV with OpenCL and AMD’s APPML libraries enabled.
Please visit us at AMD developer central where you will find resources including community forums to help you create your Heterogeneous Computing solutions. Please use the forums to provide input on OpenCV or any other aspect of the AMD APP SDK. We love hearing your ideas to help us keep improving!
Also, please participate in the OpenCV forums, and contribute to the development of openCV, or simply get the latest and greatest source code in github. And stay tuned for more updates as we work to make computer vision faster via heterogeneous compute, and even easier to integrate!
Download AMD APP SDK 2.8.1 here. For best results with APP SDK 2.8.1, we recommend you update to AMD Catalyst 13.6 beta2 drivers or newer.
Dr. Harris Gasparakis is the OpenCV-CL project manager, technical lead, and evangelist. His postings are his own opinions and may not represent AMD’s positions, strategies or opinions. Links to third party sites, and references to third party trademarks, are provided for convenience and illustrative purposes only. Unless explicitly stated, AMD is not responsible for the contents of such links, and no third party endorsement of AMD or any of its products is implied.