Monday, August 27, 2018

node.js - How to select lines to find receipt with Hough transform?

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:



example one



example two



example three

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...