A4-paper-sheet-detection-and-cropping java

Viewed 30

To complete my project, I implemented in Java greyscale, Hough transform, perspective transform of given RGB A4 size image.

What I did in the code:

  • First, the input image is converted to grayscale.
  • Then, Sobel filter is applied to find edges in the image.
  • Next, threshold is applied to find strong edges.
  • After that, Hough transform is used to find lines in the image.
  • Finally, the corners of the paper sheet are found and the image is cropped.

But code output will be black page. output should be

enter image description here

by inputing

enter image description here

1 Answers

The way you describe means the image is processed in quite a number of steps to find the coordinates to be used for cropping.

Maybe use these coordinates, but do not crop the processed picture but the original one. With that you should not just get a black page and it may get easier to find if the crop edges were detected correctly.

Related