mirror of
https://github.com/ColonelParrot/jscanify.git
synced 2025-12-31 06:31:54 +00:00
Fix highlightPaper blank canvas when no contours detected
This commit is contained in:
parent
14809392a6
commit
eecb41ff37
@ -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 &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user