open CV with processing - Error

I'm trying to work with the openCV library. I keep getting errors (I've tried to install both 32-bit and 64-bit processing, and followed the exact instructions online). This is the code I'm trying to run (the most basic one i think):

import*;        //  Imports the OpenCV library
OpenCV opencv;                    //  Creates a new OpenCV Object

void setup()

  size( 320, 240 );

  opencv = new OpenCV( this );    //  Initialises the OpenCV object
  opencv.capture( 320, 240 );     //  Opens a video capture stream


void draw()
{;                  //  Grabs a frame from the camera
  opencv.absDiff();               //  Calculates the absolute difference
  image( opencv.image(), 0, 0 );  //  Display the difference image


void keyPressed()
  opencv.remember();              //  Remembers a frame when a key is pressed

This is the error I get: A library relies on native code that's not available. Or only works properly when the sketch is run as a 64-bit application.

Any help would be appreciated!, thanks


For the old school OpenCV 1.0 wrapper make sure you install OpenCV 1.0 first. So on Windows install the OpenCV1.0 and in the install tick the Add <...>\OpenCV\bin to system PATH checkbox when you install it, or manually add the PATH to environment variables. On OSX it's a matter of installing the OpencV.framework. The Processing wrapper should work after that.

That wrapper is a bit outdated though. You might want to try Greg's OpenCV Processing wrapper

Depends on what version of OpenCV you are using, the library hypermedia doesn't work for processing 2.0 If you want to continue with that code you need to get Processing 1.0 but I recommend to update the OpenCV library.

Need Your Help

How to find out, whether a DOMElement/DOMNode is a subnode of a DOMDocument in PHP?

php dom domdocument appendchild

I have a DOMElement. How can I find out, wheter it is a subnode of a DOMDocument?

Replacing keywords in text with php & mysql

php mysql preg-replace str-replace

I have a news site containing an archive with more than 1 million news.