document-scanner-opencv
TypeScript icon, indicating that this package has built-in type declarations

1.0.35 • Public • Published

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
        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
        contourColor: { r = 255, g = 255, b = 255 }, // color of the contours
    })

Readme

Keywords

none

Package Sidebar

Install

npm i document-scanner-opencv

Weekly Downloads

34

Version

1.0.35

License

ISC

Unpacked Size

30.3 kB

Total Files

14

Last publish

Collaborators

  • matheustt098