As per your question, I understand that you want to make a black boundary at some spatial coordinates. Since you already have the boundary coordinates, you can do by setting the following condition to each coordinates by taking a loop over all points (x,y):
Also, as per your example, you want to extract the coordinates of black boundary in an image. You can do by using the following command
Hope it will help.