From eecb41ff37498c93889109223036d6feb4ef124e Mon Sep 17 00:00:00 2001 From: ColonelParrot <65585002+ColonelParrot@users.noreply.github.com> Date: Sat, 15 Apr 2023 18:53:16 -0400 Subject: [PATCH] Fix highlightPaper blank canvas when no contours detected --- src/jscanify.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/jscanify.js b/src/jscanify.js index ef17fe0..2aab57f 100644 --- a/src/jscanify.js +++ b/src/jscanify.js @@ -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 &&