# Find points inside a contour

Hello, I am trying to get the coordinates of all the points which compose an instance for all the different instances in a binary image. To do so, I first get all the contours (which define an instance) with cv2.findContours(). Then, I want to get all the points inside a contour and I have only found this way (see below) of doing so. I am sure there is a more efficient way to do so (without my dummy_mask for example) but I havn't found it).

import numpy as np
import cv2
def shape_from_contour(img, contour):