Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

getting area points inside contour

Hello,

is it possible not only to get the area inside a contour but also the corresponding points of the area?

getting area points inside contour

Hello,

is it possible not only to get the area inside a contour but also the corresponding points of the area?

EDIT -- Answer to my original problem (see below):

def getContourStat(contour,image):
  mask = np.zeros(image.shape,dtype="uint8")
  cv2.drawContours(mask, [contour], -1, 255, -1)
  mean,stddev = cv2.meanStdDev(image,mask=mask)
  return mean, stddev

Even if I dont get the points itself, I get the statistics I need. Nevertheless I think it's quite inefficient for many contours.