1 | initial version |
To get the photo-borders: From the canny-edge image compute the 4 longest surrounding lines via HoughLinesP and then compute the intersection points.
In this nice tutorial it is explained in more detail: http://opencv-code.com/tutorials/automatic-perspective-correction-for-quadrilateral-objects/