I'm working in a code to crop a receipt from an image. I'm developing the solution in javascript with the "opencv4nodejs" module, but I'm used to Python and C++.
I've seen different methods like this, but this solution doesn't work in noisy backgrounds and if the contour detected is not continuous. So I decided to make a code with the Hough Transform.
The algorithm is: image > grayscale > gaussian blur > dilate > canny > Hough Probabilistic.
In some images I have a good result, I just need to filter the best lines to get the 4 corners and crop the image. In others I have a lot of noise. How can I filter the lines to best fit the receipt?
Here are some examples of images:
No comments:
Post a Comment