Find corners of a page after applying hough transformation

1.1k views Asked by At

My classmate and I are currently working on a course project and we need some guidance. We decided to recreate "CamScanner" app using Matlab.

We can select corners manually and we were successfully able to apply the perspective transformation to straighten the image and Bradley's adaptive threshold to get the desired black and white image.

Yet, we are trying to improve our project more by selecting the corners automatically. We were able to detect the edges using box filter (Sobel) for vertical, horizontal and even diagonal and enhance the results even more. (see the right pictures below).

Then we compute the Hough transform using the edges we got from the previous step, and so, we are able to find Hough lines. Now what's left for us is to detect the corners, which is by finding 4 lines out of the 16 lines found from hough transform. (Using directly four lines in hough transform would result in the detection of the image's whole boundary, 16 was ideal for almost all our test data).

Any suggestions on how to detect corners in a simple way after the steps we made? We tried both detectHarrisFeatures and detectMinEigenFeatures to detect corners and we didn't get any satisfactory results. We are open to any suggestion, Thanks!

Our testing data: 1. On the right; results after applying horizontal/vertical/diagonal edge detection 2. On the left; the 16 hough lines

Test Data 1 - a page from a book Test Data 2 - a page from notebook

PS: I didn't know where the exact right place to post my question, so I posted here and also on Matlab Community.

0

There are 0 answers