Ask Your Question

Revision history [back]


You can try this approach!

  1. Apply Binary thresholding to the image.

image description

  1. Find contours with CV_RETR_LIST
  2. Now filter the contours based on contour Area.
  3. You can find the required two smaller contours marked as red. image description
  4. Now create new contour set named as vector<point> merged_contour_points;
  5. Add these smaller contours in merged_contour_points.

    e.g merged_contour_points.push_back(contours[i]);// filtered smaller contours.

  6. Find Convex hull for the Merged contour points. Hope this helps for your problem.