lst_intensities = []
for i in range(len(contours)):
    cimg = np.zeros_like(img)
cv2.drawContours(cimg, contours, i, color=255, thickness=-1)
pts = np.where(cimg == 255)
lst_intensities.append(img[pts[0], pts[1]])
Access pixel values within a contour boundary using OpenCV in Python