I have images with white background and simple shapes in them (each image has one shape). I want to determine if a certain point (x,y) is inside the shape or not. How can I
if you want to access all the points inside the convex hull, you can do masking
I solve this by first painting my convex hull white colour with cv2.fillPoly() on a black frame
black_frame = np.zeros_like(your_frame).astype(np.uint8)cv2.fillPoly(black_frame , [hull], (255, 255, 255))mask = black_frame == 255targetROI = your_frame * maskblack_frame = np.zeros_like(your_frame).astype(np.uint8)
cv2.fillPoly(black_frame , [hull], (255, 255, 255))
mask = black_frame == 255
targetROI = your_frame * mask