Fix highlightPaper blank canvas when no contours detected

This commit is contained in:
ColonelParrot 2023-04-15 18:53:16 -04:00
parent 14809392a6
commit eecb41ff37

View File

@ -95,6 +95,7 @@
const img = cv.imread(image);
const maxContour = this.findPaperContour(img);
cv.imshow(canvas, img);
if (maxContour) {
const {
topLeftCorner,
@ -103,8 +104,6 @@
bottomRightCorner,
} = this.getCornerPoints(maxContour, img);
cv.imshow(canvas, img);
if (
topLeftCorner &&
topRightCorner &&