Thursday, 9 August 2012

Problems Setting up 64 bit OpenCV

If you've been following the Game Player project I've been blogging about you'll know I has some trouble getting the 64 bit libraries of OpenCV to link with my project and had to stick with the 32 bit ones. Here I'll go into more details about the problem and hopefully find a solution.

First a little bit of background information on my system:
  • Windows 7 Home Premium 64 bit
  • OpenCV 2.4.2 pre-compiled binaries
  • Netbeans 7.0.1
  • Java 1.6 (not sure of bitness)
  • MinGW-32 C Compiler with gcc version 4.5.2

Wednesday, 8 August 2012

Game Player - Step 1 - Setting Up and Using OpenCV

This is the part I hate the most because it can be fraught with errors and you can end up spending masses of time on what is essentially just setting up the environment. I don't mind spending ages on a problem when it is a problem in development or trying to work out how to solve a tricky algorithm issue but spending ages on just setting something up drives me mad. Hopefully it will go smoothly this time...

Friday, 3 August 2012

Game Player - Step 1 - Transfer BufferedImage to C

When we ended the last post we had our screen captured and stored in a Java BufferedImage object. The problem we face now is that we want to do all our reasoning inside C using OpenCV, not in Java, so we need a way to gain access to the image data from C. This is where JNI and our native methods come into play.

So far we have only defined one native method that prints a line to the screen letting us know the library has been loaded successfully. In reality we don't need to print this message as an exception will be thrown if the library doesn't load but we'll leave it in for now just for the added reassurance. We will also define another native method but this time we will pass in our newly acquired image with it. There is just one small task we want to do before hand though...