From a8244709e6e8a38f0492b2572eea8c82e999b33a Mon Sep 17 00:00:00 2001 From: ColonelParrot <65585002+ColonelParrot@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:55:35 -0500 Subject: [PATCH] Update README.md --- README.md | 131 +----------------------------------------------------- 1 file changed, 1 insertion(+), 130 deletions(-) diff --git a/README.md b/README.md index 0d4150b..aed2a30 100644 --- a/README.md +++ b/README.md @@ -1,130 +1 @@ -
-
-
-Powered with opencv.js
-Supports the web, NodeJS, React, and others.
-
-Available on npm or via cdn
-
-
-
-```
-
-```js
-const scanner = new jscanify();
-image.onload = function () {
- const highlightedCanvas = scanner.highlightPaper(image);
- document.body.appendChild(highlightedCanvas);
-};
-```
-
-### Extract Paper
-
-```js
-const scanner = new jscanify();
-const paperWidth = 500;
-const paperHeight = 1000;
-image.onload = function () {
- const resultCanvas = scanner.extractPaper(image, paperWidth, paperHeight);
- document.body.appendChild(resultCanvas);
-};
-```
-
-### Highlighting Paper in User Camera
-
-The following code continuously reads from the user's camera and highlights the paper:
-
-```html
-
-
-
-
-```
-
-```js
-const scanner = new jscanify();
-const canvasCtx = canvas.getContext("2d");
-const resultCtx = result.getContext("2d");
-navigator.mediaDevices.getUserMedia({ video: true }).then((stream) => {
- video.srcObject = stream;
- video.onloadedmetadata = () => {
- video.play();
-
- setInterval(() => {
- canvasCtx.drawImage(video, 0, 0);
- const resultCanvas = scanner.highlightPaper(canvas);
- resultCtx.drawImage(resultCanvas, 0, 0);
- }, 10);
- };
-});
-```
-
-To export the paper to a PDF, see [here](https://stackoverflow.com/questions/23681325/convert-canvas-to-pdf)
-
-### Notes
-
-- for optimal paper detection, the paper should be placed on a flat surface with a solid background color
-- we recommend wrapping your code using `jscanify` in a window `load` event listener to ensure OpenCV is loaded
-
-