Skip to content

matheustavarestrindade/Document-Scanner-OpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple OpenCV Module to scan documents

Description

This module is a simple OpenCV module to scan documents.

Installation

npm install --save opencv-scanner

Import the OpenCV Script from : `https://docs.opencv.org/4.6.0/opencv.js`

Usage

    detect({
        detectElement // Element to be detected (Image or Canvas)
        showContours = false, // Show contours on detected object
        drawRectangle = false, // Draw rectangle on detected object
        scanElement,// Canvas element to draw on0
        resultElement, // Canvas element to draw the result
        img: { height = 640, width = 480 },// resolution of the image
        contourColor: { r = 255, g = 255, b = 255 }, // color of the contours
    })

    const {stop} = await detectVideo({
        videoDisplayElement, // Element to display the video
        showContours = false, // Show contours on detected object
        drawRectangle = false, // Draw rectangle on detected object
        scanElement, // Canvas element to draw on
        resultElement, // Canvas element to draw the result
        onDetect, // Callback function to be called when a document is detected
        fps = 30, // Frames per second
        img: { height = 640, width = 480 }, // resolution of the image
        contourColor: { r = 255, g = 255, b = 255 }, // color of the contours
    })

About

Document Scanner API made in JavaScript and OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published