title: JavaCV example is not working - what am I missing?
body: <p>It's the first day of learning JavaCV for me. And this is the first test example which I use just to make sure that my setup is done correctly. Unfortunately I can't run the example and I barely understand the code and all dependencies so it's really hard for me to find out what is missing. Below I'll post my project setup and also the errors I get.</p>
  
  <p>Also the example I use is from: <a href="http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/javacv-capture-save-flip-show-live.html" rel="nofollow noreferrer">http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/javacv-capture-save-flip-show-live.html</a></p>
  
  <p><strong>code</strong></p>
  
  <pre><code>import static com.googlecode.javacv.cpp.opencv_core.cvFlip;
  import static com.googlecode.javacv.cpp.opencv_highgui.cvSaveImage;
  import com.googlecode.javacv.CanvasFrame;
  import com.googlecode.javacv.FrameGrabber;
  import com.googlecode.javacv.VideoInputFrameGrabber;
  import com.googlecode.javacv.cpp.opencv_core.IplImage;
  
  public class GrabberShow implements Runnable
  {
      //final int INTERVAL=1000;///you may use interval IplImage image;
      CanvasFrame canvas = new CanvasFrame("Web Cam");
      public GrabberShow()
      {
          canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
      }
      @Override
      public void run()
      {
          FrameGrabber grabber = new VideoInputFrameGrabber(0); // 1 for next camera
          int i = 0;
          try
          {
              grabber.start();
              IplImage img;
              while (true)
              {
                  img = grabber.grab();
                  if (img != null)
                  {
                      cvFlip(img, img, 1);// l-r = 90_degrees_steps_anti_clockwise
                      cvSaveImage((i++) + "-aa.jpg", img); // show image on window
                      canvas.showImage(img);
                  }
                  //Thread.sleep(INTERVAL);
              }
          }
          catch (Exception e)
          {
  
          }
      }
  }
  </code></pre>
  
  <p>I use <code>Eclipse</code> and it seems like all imports are there.</p>
  
  <p>Here is a print screen of my project as it looks like in <code>Eclipse</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/cEjOX.gif" alt="enter image description here"></p>
  
  <p>So this is it for the setup. I try to get something out of this. When I right click on the project and try to <code>Run</code> it as <code>Java Application</code> the following windows is showing up:</p>
  
  <p><img src="https://i.stack.imgur.com/GFvQE.png" alt="enter image description here"></p>
  
  <p>You can see my choice at the top of the window. The I get an error window <code>A Java Exception has occurred</code> and here is part of the error I get in the console window:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Xman\AppData\Local\Temp\javacpp4929678155627\jniopencv_core.dll: Can't find dependent libraries
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(Unknown Source)
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.load0(Unknown Source)
  at java.lang.System.load(Unknown Source)
  at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:422)
  at com.googlecode.javacpp.Loader.load(Loader.java:372)`
  </code></pre>
  
  <p>I've read the error, it seems like the problem is caused by missing libraries but I'm not sure, also I have followed the instructions (which weren't that many in fact) and from the comments below the example code it seems that it actually works. So I guess the problem is somewhere here - in my project, code, setup, but I can't find what I'm missing or doing wrong.</p>