1 | initial version |
You can get the pixels inside the shape using drawcontours: you will create a black image of the same size of your image, then draw the shape on it (be careful to use thickness=CV_FILLED
) in white. You will then be able to detect if pixel (x,y)
is inside the shape or not...
You can also use pointpolygontest to test points, but the performances are probably worse than the previous version...