doc_scanner_cropper
v1.1.5
Published
Lib for scanning and auto-cropping documents
Downloads
3
Readme
doc_scanner_cropper
Getting Started
npm install doc_scanner_cropper
Prerequisites
The things you need before installing the software.
Example
//test.js.
const { initOpenCV, imageProcess } = require("doc_scanner_cropper");
let init = true;
function runInitOnce() {
if (init) {
initOpenCV().then((openCVinitialised) => documentProcessing());
init = false;
} else {
documentProcessing();
}
}
const documentProcessing = () => {
/*
*method takes 3 arg [imageProcess('<YOUR_IMAGE_PATH>',MAX_WIDTH,MAX_HEIGHT)]
* MAX_WIDTH & MAX_HEIGHT are required.
*/
imageProcess("./testImg.jpg", 1000, 800)
.then((ProcessedImage) => {
console.log("base64 image", ProcessedImage.croppedImageKey);
})
.catch((err) => console.log(err));
};
runInitOnce();
//Run "node test.js" to see the output.
Roadmap.
- [x] ~~Add Readme~~.
- [ ] Two output format.
- [x] ~~Base64 format.~~
- [ ] Image as a file format.
- [ ] Typescript compatibility.
- [ ] Dynamic change in orientation of image.