Need an algorithm that will detect and correct the perspective of a picture of a document/paper. The following actions will be performed to the image:
1) Detection of document corners (if surface allows it).
2) Perspective correction based on the specified corners (turn quadrilateral polygon into a rectangle)
I need specifically these 2 functions in VB or C#:
1) detectEdges(Bitmap inputImage) //returns 4 coordinate points of a quadrilateral polygon
2) correctPerspective(Bitmap inputImage, point coord1, point coord2, point coord3, point coord4) //returns the corrected image where the selected object must be in rectangle form.
- Code must be as light and as fast as possible, because code will run on a mobile phone.
- Memory usage should be as low as possible.
- No use of third party APIs, must be 100% native code.
- A sample of the desired output here: [url removed, login to view]