You might find Point in Polygon algorithms useful: https://en.wikipedia.org/wiki/Point_in_polygon
It would be a lot simpler if the object were guaranteed to be convex, but I doubt that is the case.
Here is a simple-ish method. Do a cumsum() horizontally on the binary boundary image. For any pixels with an odd cumsum value, they are in the shape. Or that binary mask with the boundary pixels, and you'll get a binary mask for your full shape.
There is an edge case where a boundary is horizontal, so your cumsum will run exactly along the boundary. I'm not sure how to handle that case robustly...
There are probably more efficient/robust methods as well.