Finding corners of a polygon represented in a 2D array
i have an idea about how u can make a function for this by your self. according to what i understand only the for corners can have more than one "0" next to it. 
if you take array[x,y] to be a point. array[x-1,y],array[x+1,y],array[x,y+1],array[x,y-1] are the 4 point close to it. you can make a loop to go through the array checking the four neighbors if the value is "1" and count the number of neighbors which has value "0". those point that has more than one(has two) neighbors with value "0" are you four corners.
I have a 2D array of 0's and 1's where the 1's represent the edges and inside of a quadrilateral, and 0's are everything outside. What is the best way to find the coordinates of the four corners?
I'm using Python so any libraries that can help are fine, but an algorithm in any language would be helpful as well.