title: Extract polygons by color from mask image
body: <p>I would like to extract the Polygon Shape by color, if it's possible the corner coordinates, <a href="https://i.stack.imgur.com/ZYHYI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZYHYI.png" alt="example of mask"></a></p>
  
  <p>Currently i'm trying with open-cv find contourns, but it's very <strong>precise</strong> i'm getting a lot of coordinates. what i want it's just the corner points to make the polygon by color.</p>
  
  <pre><code>img = cv2.imread('mask_ZT76_39_A_2_8.png', 0)
  img = cv2.medianBlur(img, 5)
  thresh =     cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,\
  cv2.THRESH_BINARY,11,2)
  
  image, contours, hierarchy = cv2.findContours(thresh.copy(),cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
  
  cv2.drawContours(image, contours, -1, (0,255,0), 3)
  
  approx_=[]
  
  for i in range(len(contours[0])):
    epsilon = cv2.arcLength(contours[0][i],True)
    approx = cv2.approxPolyDP(contours[0][i],epsilon,True)
  </code></pre>
  
  <p>Thanks.</p>