Fixed the following bugs:
New features:
- optimized
extractPaper
to save compute whencornerPoints
is passed in. Therefore, the following two snippets are equal in performance:
Short:
const result = scanner.extractPaper(image, paperWidth, paperHeight);
Long:
const contour = scanner.findPaperContour(cv.imread(image));
const cornerPoints = scanner.getCornerPoints(contour);
const result = scanner.extractPaper(image, paperWidth, paperHeight, cornerPoints);
Previously, the longer version would take twice as long. This has since been fixed.
As always, if you have any concerns or questions, feel free to raise an issue or start a discussion post. I'm always happy to help.