title: OpenCV Convex Hull coordinates
body: <p>
  I wanted to find the convex hull in order to even the edges of a hand-drawn triangle on paper. Smoothing using image processing was not enough because i needed to detect this triangle too and a hand drawn triangle tends to have more than three points if the approxPolyDP function is used. A convex hull of a triangle is correctly identified by the approxPolyDP function.</p>
  
  <p>The problem is, i have other shapes in the image too on which a convex hull is created.</p>
  
  <p><a href="https://i.stack.imgur.com/wqAsk.jpg" rel="nofollow noreferrer">Before convex hull is used: Notice the contour labelled 3</a></p>
  
  <p><a href="https://i.stack.imgur.com/2nXvj.jpg" rel="nofollow noreferrer">After convex hull is used: the end points have been joined and the contour labelled 3 forms a triangle</a></p>
  
  <p>Now i wanted to somehow exclude contour 3 from being detected as a triangle.
  To do this my strategy was to remove this contour altogether from the ArrayList named hullMop. This is because my triangle detection function uses the contours from hullMop and so it wouldnt even check the contour labelled 3.</p>
  
  <p>extcontours are the contours before convex hull is used.
  This function checks if a point from hullMop is inside extcontours. If it isn't, then that must be removed from hullMop because they are the extra set of points generated because of the convex hull, or in other words, the red line in the second image.</p>
  
  <p>Now at this point I feel there is a hole in my concept. The openCV documentation says that the convex Hull returns the subset of the points of the original array, in other words, subset of the points of extcontours. </p>
  
  <p>My question is, how do i get the points of the red line created by the convexHull function. I dont want to use findContours because i feel there is a better way. 
  </p>
  
  <pre><code>private void RemoveFalseHullTriangles(ArrayList&lt;MatOfPoint&gt; extcontours, ArrayList&lt;MatOfPoint&gt; hullMop, int width, int height) {
      //if every single point of hullmop doesnt touch or isn't inside extcontours, then that point must be the red line
      MatOfPoint2f Contours2f = new MatOfPoint2f();
      double [] newA = new double[2];
      int hullCounter = 0;
      A: for(int i =0;i&lt;extcontours.size();i++) {
          MatOfPoint ExtCnt = extcontours.get(i);
          MatOfPoint HullCnt = hullMop.get(hullCounter);
          ExtCnt.convertTo(Contours2f, CvType.CV_32F);
          B: for (int j = 0; j &lt; HullCnt.rows(); j++) {
              double[] pt = new double[2];
              pt[0] = HullCnt.get(j,0)[0];
              pt[1] = HullCnt.get(j,0)[1];
  
              if (Math.abs(Imgproc.pointPolygonTest(Contours2f, new Point(pt), true)) &gt; 40) {
                      //Remove index from HullMop
                  hullMop.remove(hullCounter);
                  hullCounter--;
                  break B;
              }
  
  
          }
          hullCounter++;
      }
  }
  </code></pre>
  
  <p>
  Because the hullMop only has a subset of the points of extcontours, i may never know the points of the red line of the contour labelled 3 after convex hull is used. 
  
  Is there anyway to get coordinates of that red line generated by convex hull other than using findContours?</p>