title: Using OpenCV in Java with JavaCV
body: <p>I am getting desperate !! I am trying to use <strong>OpenCV</strong> in <strong>Java</strong>, via <strong>JavaCV</strong> (JNA to wrap OpenCV for java).</p>
  
  <p>I am on <strong>Mac Os X</strong> 1.5.</p>
  
  <p>I installed OpenCV, and I can compile and run the examples included. So that works.</p>
  
  <p>Now I open <strong>Eclipse</strong>, and I create a new project, as described here :
  <a href="http://code.google.com/p/javacv/" rel="noreferrer">http://code.google.com/p/javacv/</a></p>
  
  <p>In that new project, only one small class with a call to a opencv function (I used the sample code) :</p>
  
  <pre><code>import static name.audet.samuel.javacv.jna.cxcore.*;
  import static name.audet.samuel.javacv.jna.cv.*;
  import static name.audet.samuel.javacv.jna.highgui.*;
  import static name.audet.samuel.javacv.jna.cvaux.*;
  
  public class Test {
      public static void main(String[] args) {
          IplImage image = cvLoadImage("test.png", 1);
          if (image == null) {
              System.err.println("Could not load image file.");
          } else {
              cvSmooth(image, image, CV_GAUSSIAN, 3, 0, 0, 0);
              // ...
          }
      }
  }
  </code></pre>
  
  <p>When I run it, I have the following error :</p>
  
  <blockquote>
    <p>Exception in thread "main"
    java.lang.UnsatisfiedLinkError: Unable
    to load library 'cxcore':
    dlopen(libcxcore.dylib, 9): image not
    found</p>
  </blockquote>
  
  <p>Please, I need help, I looked over google for hours, I don't know where to look for anymore.</p>