I have trained a polygon detector neural network to recognize the mask of "quadrilateral" (the mask generates curvy lines so it's not exactly a quadrilateral). I would like to get the corners of the quadrilateral.
I believe the best approach is to get the points in the mask that are closest to the corners of the image. First question is are these valid assumptions? Second question is is this the best approach?
Top-Left is minimum distance between (0,0) and mask.
Top-Right is minimum distance between (width, 0) and mask.
Bottom-Left is minimum distance between (0, height) and mask.
Bottom-Right is minimum distance between (width, height) and mask.
The last question is my implementation is slow. The Neural network generates the mask in .7 seconds, but it's taking my loop ~2 seconds to find the corners. Can this be sped up?
How to speed up Python web crawler?
How to speed up window leveling (brightness, contrast)?