title: Convex Hull on Java Android Opencv 2.3
body: <p>Please help me, </p>
  
  <p>I have a problem for Convex Hull on Android. I use Java and <strong>OpenCV 2.3</strong>.</p>
  
  <p>Before I made it on Java, I made it on C++ with Visual Studio 2008.</p>
  
  <p>This code can running successfully on C++.  </p>
  
  <p>Now, i want to convert it from C++ to Java on Android. And I found error like "force close" when i run it on SDK Android simulator.</p>
  
  <p>This is my code on C++: </p>
  
  <pre><code>vector&lt;vector&lt;Point&gt; &gt; contours;
  vector&lt;Vec4i&gt; hierarchy;
  
  findContours( canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
  drawing = Mat::zeros( canny_output.size(), CV_64F );
  
  /// Find the convex hull object for each contour
  vector&lt;vector&lt;Point&gt; &gt; hull ( contours.size() );
  for( int i = 0; i &lt; contours.size(); i++ )
    {  convexHull( Mat(contours[i]), hull[i], false );
  }
  
  for(size_t i = 0; i &lt; contours.size(); i++){
      drawContours( drawing, hull, i, Scalar(255, 255, 255), CV_FILLED ); // FILL WHITE COLOR
  }
  </code></pre>
  
  <p>And this is my code on Android: </p>
  
  <pre><code>Mat hierarchy = new Mat(img_canny.rows(),img_canny.cols(),CvType.CV_8UC1,new Scalar(0));
      List&lt;Mat&gt; contours =new ArrayList&lt;Mat&gt;();
      List&lt;Mat&gt; hull = new ArrayList&lt;Mat&gt;(contours.size());
      drawing = Mat.zeros(img_canny.size(), im_gray);
  
      Imgproc.findContours(img_dilasi, contours, hierarchy,Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE, new Point(0, 0));
  
      for(int i=0; i&lt;contours.size(); i++){
          Imgproc.convexHull(contours.get(i), hull.get(i), false);
  
      }
      for(int i=0; i&lt;contours.size(); i++){
          Imgproc.drawContours(drawing, hull, i, new Scalar(255.0, 255.0, 255.0), 5);
      }
  </code></pre>
  
  <p>For your info, I did a little modification on Convex Hull at my code. <strong>I fill a color inside contour</strong>. </p>
  
  <p>Anyone can help me to solve my problem? </p>
  
  <p>I'm very grateful for your help. </p>