title: Using OpenCV Android porting
body: <p>I want to use the OpenCV Android porting, that you can find <a href="http://github.com/billmccord/OpenCV-Android" rel="nofollow noreferrer">HERE</a>, to make some image transformations for an Augmented Reality application. I've found no problem configuring and building the library, I receive no error and I succed put it within my Android application throght JNI process: the library libopencv.so is in the correct directory "\libs\armeabi\" under my project's directory.
  And now the problems:</p>
  
  <p>1) First I want to understand what version of the original openCV library this porting derive from. Is important for me know if it derive from version 1.5, 2.0 or 2.1 because same functions are very different and others are absent.</p>
  
  <p>2) Before starting with real time video manipulation, I'd try make some simple operations on a single image or saved video:</p>
  
  <p><pre><code>
  JNIEXPORT
  jstring
  JNICALL
  Java_org_examples_testOpenCV_OpenCV_LoadImage(JNIEnv* env, jobject thiz)
  {
      IplImage* imgIn = cvLoadImage("/sdcard/testimage.jpg", -1);</p>
  
  <pre><code>if (!imgIn) return env-&gt;NewStringUTF("Error");
  
  cvReleaseImage( &amp;imgIn );
  
  return env-&gt;NewStringUTF("Ok");
  </code></pre>
  
  <p>}
  </pre></code></p>
  
  <p><pre><code>
  JNIEXPORT
  jstring
  JNICALL
  Java_balmas_examples_testOpenCV_OpenCV_manageVideo(JNIEnv* env, jobject thiz)
  {
       CvCapture* capture = cvCaptureFromFile("/sdcard/video_galaxyspica_352x288_15fps.3gp");</p>
  
  <pre><code>    if (!capture) return env-&gt;NewStringUTF("Error");
  
      return env-&gt;NewStringUTF("Ok");
  </code></pre>
  
  <p>}
  </pre></code></p>
  
  <p>In both cases I receive "Error". There are no problems with files on the sdcard becouse I try to make this:</p>
  
  <p><pre><code>
  FILE* file = fopen("/sdcard/video_galaxyspica_352x288_15fps.3gp","w+");</p>
  
  <p>//FILE* file = fopen("/sdcard/testimage.jpg","w+");</p>
  
  <pre><code>if (!file) return env-&gt;NewStringUTF("Error");
  else {
      fflush(file);
      fclose(file);
      return env-&gt;NewStringUTF("OK");
  }
  </code></pre>
  
  <p></pre></code></p>
  
  <p>and I receive "OK".
  I realize that there is some problem within highgui library but I don't understand what and wath I should make to avoid the problem.
  Some suggestions!!!</p>
  
  <p>Thank you everyone</p>