Showing posts with label GPU. Show all posts
Showing posts with label GPU. Show all posts

Wednesday, January 8, 2014

Building OpenCV 2.4.8 with CUDA and running GPU methods in Java using JNI

Though OpenCV comes with Java bindings since version 2.4.4, there are still some modules that don't have Java bindings - the most obvious one being the gpu module.

The OpenCV distribution for Windows is not built with CUDA so the gpu module doesn't work out of the box. So the first step is to build the OpenCV binaries with CUDA. As there are no Java bindings for the gpu module, a Java application wanting to use gpu methods will need to use JNI (Java Native Interface) to talk to the OpenCV gpu DLL. This is described in a complete example at the end of this post.