{"_id":"@anpanman/opencv-wasm","_rev":"2-2d8580b4dea8057bd2b2be8ad141a8c0","name":"@anpanman/opencv-wasm","dist-tags":{"latest":"4.3.0-10"},"versions":{"4.3.0-10":{"name":"@anpanman/opencv-wasm","version":"4.3.0-10","description":"Precompiled OpenCV 4.3.0 to JavaScript + WebAssembly for node.js environment","main":"index.js","directories":{"example":"examples","test":"test"},"scripts":{"test":"npx mocha ./test/test.js"},"repository":{"type":"git","url":"git+https://echamudi@github.com/echamudi/opencv-wasm.git"},"author":{"name":"Ezzat Chamudi"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/echamudi/opencv-wasm/issues"},"homepage":"https://github.com/echamudi/opencv-wasm#readme","devDependencies":{"@types/mocha":"^8.2.0","@types/node":"^14.0.1","chai":"^4.2.0","jimp":"^0.10.2","js-beautify":"^1.13.4","mocha":"^7.1.2","pixelmatch":"^5.2.0"},"dependencies":{},"keywords":["opencv","wasm","typescript"],"gitHead":"49909153c67c29ee7535598fd55e256ffec34999","_id":"@anpanman/opencv-wasm@4.3.0-10","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-TJUgd8ELsh4X04X3qyNMPvflnSllPNhhXZnlorTFrWjo6PnHn/uMBVkIBfDO4I/gCVprmQPnpi2/NKkhXR2PRg==","shasum":"2c7389903e42e29bf9e040fefbd1e03878de7e73","tarball":"https://registry.npmjs.org/@anpanman/opencv-wasm/-/opencv-wasm-4.3.0-10.tgz","fileCount":12,"unpackedSize":17104535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwyMrCRA9TVsSAnZWagAATJYP/isVfIOtseTAphvJ7bZP\nw8Q3BbdMBLg93yvOUYMJc3sj1jNkF9UXnXqHPw4dYNSe6NcL/9JqDJtSvhjw\nLeIb05cOUSpr+tcKmBWvhjp0zi+WELdGOYImg8178Z9Q/VOkm9SczbH/rA68\nHpUbUjNJfLoot1M7C70L3mTqq7uEkYP2/wC7stPdLVxRI0BEPKP/CRPvo+Iu\nnMMPekKUVwFKtLl+s8tBIaZ6zd4ocFj4qeNyt8dQfXWVGiinh4KHx1CsNgqg\n9/SMJ91815iJxqRNviA50rvYXQ4X9U6IivUcCaS1bUTIj7kt1WHSgDsTApaL\nYPudPvQEDUGtT7fZoQBG96EqdmrwUZgqFT0tvBJ2tUxDLT2tEEjhDjXS/Hd6\nbZKBIgiM+wWes/YE8TTH97CrJjAV7cS0Ne1y+QDbzsK0cb5LfDsL4BNK1d8K\nhaNgUA14U9/NB+kIOrMQS2BJrBqcRcLJF7tUiuksMGHowJvijGfV+b6rgNrB\nuHuJayAV3fKn2B8961lEHW/70B9teJqzRjsoSHx+TImkpZUDTAO1HQ5/ZYEf\nRmUWzYMHwhtpmjCDSHCBz3QxkrZlfM87UH8RawjpmVY4DKWK1C+nXjc4HyHG\nRBKn+mmvdmx+GORhEFuqsf+xdAA/tqnLlab4exp+uQ0g7swgKJgP16pXM95a\nJnHr\r\n=sOl0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY2MaDMHLk3Uhy1V8hR5P76TLGORbV6j47bENJ679A1AIhAKtbtNFXw9O6s2k9Qv0+NXFSqwmV4mq9g2ILGq07ll+I"}]},"_npmUser":{"name":"anpanman","email":"stratoss@gmail.com"},"maintainers":[{"name":"anpanman","email":"stratoss@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opencv-wasm_4.3.0-10_1634846194915_0.9434399710888177"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-21T19:56:34.864Z","4.3.0-10":"2021-10-21T19:56:35.388Z","modified":"2022-04-04T14:19:20.631Z"},"maintainers":[{"name":"anpanman","email":"stratoss@gmail.com"}],"description":"Precompiled OpenCV 4.3.0 to JavaScript + WebAssembly for node.js environment","homepage":"https://github.com/echamudi/opencv-wasm#readme","keywords":["opencv","wasm","typescript"],"repository":{"type":"git","url":"git+https://echamudi@github.com/echamudi/opencv-wasm.git"},"author":{"name":"Ezzat Chamudi"},"bugs":{"url":"https://github.com/echamudi/opencv-wasm/issues"},"license":"BSD-3-Clause","readme":"# OpenCV-Wasm\n\n[![Build Status](https://travis-ci.org/echamudi/opencv-wasm.svg?branch=master)](https://travis-ci.org/echamudi/opencv-wasm)\n\nPrecompiled OpenCV to JavaScript + WebAssembly for node.js and deno environment. 🦕\n\nIn this Wasm-compiled OpenCV, there's no need to have OpenCV installed in the machine. The entire OpenCV library is already inside this package (`opencv.js` and `opencv.wasm`).\n\nThis module has zero dependencies.\n\n## Examples\n\n| Code | Input | Output |\n|---|---|---|\n| [dilation.js](https://github.com/echamudi/opencv-wasm/blob/master/examples/dilation.js) (node)| ![image sample 1](https://github.com/echamudi/opencv-wasm/blob/master/examples/input/image-sample-1.jpg?raw=true) | ![dilation](https://github.com/echamudi/opencv-wasm/blob/master/examples/expected-output/dilation.png?raw=true) |\n| [templateMatching.js](https://github.com/echamudi/opencv-wasm/blob/master/examples/templateMatching.js) (node) | source:<br>![image sample 2](https://github.com/echamudi/opencv-wasm/blob/master/examples/input/image-sample-2.png?raw=true) <br>template:<br> ![image sample 2 template](https://github.com/echamudi/opencv-wasm/blob/master/examples/input/image-sample-2-template.png?raw=true) | ![template matching](https://github.com/echamudi/opencv-wasm/blob/master/examples/expected-output/template-matching.png?raw=true) |\n\n## Installation\n\n### node\n\n```\nnpm install opencv-wasm\n```\nCode example:\n```js\nconst { cv, cvTranslateError } = require('opencv-wasm');\n\nlet mat = cv.matFromArray(2, 3, cv.CV_8UC1, [1, 2, 3, 4, 5, 6]);\nconsole.log('cols =', mat.cols, '; rows =', mat.rows);\nconsole.log(mat.data8S);\n\ncv.transpose(mat, mat);\nconsole.log('cols =', mat.cols, '; rows =', mat.rows);\nconsole.log(mat.data8S);\n\n/*\ncols = 3 ; rows = 2\nInt8Array(6) [ 1, 2, 3, 4, 5, 6 ]\ncols = 2 ; rows = 3\nInt8Array(6) [ 1, 4, 2, 5, 3, 6 ]\n*/\n```\n\n### deno\n\n```ts\nimport { cv, cvTranslateError } from 'https://deno.land/x/opencv@v4.3.0-10/mod.ts';\n// Change the @<version> with the latest or any version you desire.\n// Check the available versions here: https://deno.land/x/opencv.\n```\nCode example:\n```ts\nimport { cv, cvTranslateError } from 'https://deno.land/x/opencv@v4.3.0-10/mod.ts';\n\nlet mat = cv.matFromArray(2, 3, cv.CV_8UC1, [1, 2, 3, 4, 5, 6]);\nconsole.log('cols =', mat.cols, '; rows =', mat.rows);\nconsole.log(mat.data8S);\n\ncv.transpose(mat, mat);\nconsole.log('cols =', mat.cols, '; rows =', mat.rows);\nconsole.log(mat.data8S);\n\n/*\ncols = 3 ; rows = 2\nInt8Array(6) [ 1, 2, 3, 4, 5, 6 ]\ncols = 2 ; rows = 3\nInt8Array(6) [ 1, 4, 2, 5, 3, 6 ]\n*/\n```\n\n## Usage\n\nBecause this module is using the same code as the official OpenCV.js for the web, you can use the same documentation at the web: https://docs.opencv.org/4.3.0/d5/d10/tutorial_js_root.html\n\nThere are some minor initialization changes, because this module will be loaded synchronously instead of the OpenCV's default (asynchronously). \n\nYou can check the files inside [examples](https://github.com/echamudi/opencv-wasm/tree/master/examples) folder as reference on how to initialize, loading images, and saving images.\n\n## Error Handling\n\nBy default, mistakes in code will produce error code. You can use the following snippet to translate the error code into meaningful statement from OpenCV.\n\n```js\nconst { cv, cvTranslateError } = require('opencv-wasm');\n\ntry {\n    // Your OpenCV code\n} catch (err) {\n    console.log(cvTranslateError(cv, err));\n}\n```\n\n## Versioning\n\nThis npm module uses the following versioning number:\n```\n<opencv version>-<this module version>\n```\nFor Example\n```\n4.3.0-9\nOpenCV version 4.3.0\nOpenCV-Wasm Module version 9\n```\n\n## Development\n\n### Building\n\nRun the following script on macOS or Linux (tested on Ubuntu). You need docker on the system.\n\n```\nnpm install\n(cd ./utils && sh ./build.sh)\n(cd utils && node generateCvProps.js)\n```\n\n### Testing\n\nAfter completing the build script, you can run the test provided by OpenCV, and the test from this repo.\n\n```sh\n# OpenCV's test\n(cd ./build_wasm_test/bin && npm install)\n(cd ./build_wasm_test/bin && node tests.js)\n\n# This repo's test\nnpm test\n```\n\n## Authors\n\n* **Ezzat Chamudi** - [echamudi](https://github.com/echamudi)\n\nSee also the list of [contributors](https://github.com/echamudi/opencv-wasm/graphs/contributors) who participated in this project.\n\n## License\n\nCopyright © 2020 [Ezzat Chamudi](https://github.com/echamudi) and [OpenCV-Wasm Project Authors](https://github.com/echamudi/opencv-wasm/graphs/contributors)\n\nOpenCV-Wasm code is licensed under [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause). Images, logos, docs, and articles in this project are released under [CC-BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/legalcode).\n\n[OpenCV License](https://opencv.org/license/).\n\nLibraries, dependencies, and tools used in this project are tied with their licenses.\n","readmeFilename":"README.md"}