Showing posts with label OpenCV. Show all posts
Showing posts with label OpenCV. Show all posts

Saturday, March 22, 2014

Displaying OpenCV Mat object in a JavaFX Image

Introduction

This post describes a way to display an OpenCV Mat object within a JavaFX Image.

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.

Building and Running OpenCV 2.4.8 with Java on Windows 7

OpenCV comes with Java bindings since version 2.4.4.

The OpenCV 2.4.8 distribution for Windows contains pre-compiled jar and dll files for the Java module so there is actually no need to build this module from source. These files are located in opencv/build/java/. All you need to do is import opencv-248.jar into your Java application and point to appropriate (32 or 64 bit) dll using System.load(). If you just want to know how to run an OpenCV application in Java then you can skip the build sections of this post.

But if you are interested in building the Java module then read on from the next section below.

Sunday, January 5, 2014

Building OpenCV 64 bit applications with Visual C++ 2010 Express

I've seen instructions/tutorials on how to build 32 bit OpenCV applications using Visual C++ 2010 Express and 64 bit OpenCV applications using the full-fledged Visual Studio 2010, but no instructions on building 64 bit OpenCV applications using Visual C++ 2010 Express. Hence, this post.