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