{"_id":"@ad113n/opencv-wasm-sync","name":"@ad113n/opencv-wasm-sync","dist-tags":{"latest":"4.7.0"},"versions":{"4.7.0":{"name":"@ad113n/opencv-wasm-sync","version":"4.7.0","description":"Precompiled OpenCV 4.7.0 to JavaScript + WebAssembly for node.js environment","main":"index.js","directories":{"example":"examples"},"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"},"types":"./index.d.ts","_id":"@ad113n/opencv-wasm-sync@4.7.0","_nodeVersion":"16.17.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-W7nlaG3CRjgUsPhWxapOMoOb5By1p8lrzT1ahRZvq2A3dt2DJzhRcxfkfvx+/89WYRBcbiKFNkE98JMdW/lquA==","shasum":"77c5fbef9a682c04f88bdfc70307c0fb5c7ef3e0","tarball":"https://registry.npmjs.org/@ad113n/opencv-wasm-sync/-/opencv-wasm-sync-4.7.0.tgz","fileCount":12,"unpackedSize":15823668,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwuXNCmcNBCNSrQFcPE8Er6bnkxOaUbnxMXMrCkqIXqAiEA1CU2gYl12jiMnlDxtmbvMUpS3+D1y/ozZy8Mbbz4TWw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQosKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsQhAAokhNSHyI/TzuVmdAN2tSl+tFmxbTm0yIu49io1dQnHy7gycT\r\nPQfjbEWkHAq/YJO3fogBgb9UiST9KenQOe0rM62nb9Tx+8RxHAfioJNiiSIz\r\n3ENhZU0xhcBbxWgPonSmj/+mLCXYe+QMp+QRSCdQMxlX/UvhLm9OjpGd2rqF\r\nfecFKcQIkPt4uK/F2xu/oOWSdvFcbUtpnu6YD068e+mNIsMOBDBGv4Vi4mW1\r\n64KfKuo0LbxUSqdeo1Z3b4feQOqksyZSZZTnsVEBq8h/Lw17JFDUOnaC43o+\r\nZI1/jpEawCU+lhJt6fM5tRIay6FHfiir1RWtsZBVsHpyakhWVPgtWVTpaIIH\r\nfXSCp7//H+kU3/HA0BR26nehToCWqs7UcHLWbI+hBN53JQUX5uQnQTmtT+Xf\r\n7YnPjIU35W+f+OkTGHaYFtDiBJ7EeKzBp7/qyjEkBV6b4dkR7wyrK4bmik+G\r\nrYp0WrGPogcvl3fPB6R2Bgckjg3JFh54MWFoMMMuseSGUrJ1FOWxTy7Fg+bk\r\nYKQSf7lhDvlIi3duo4zFFf68UDr5SCUya2r5hI3EuZYbGouxMMWwkPrO8nZr\r\n8jD7MfiIREuNzC3sUcZMox4s1qM4oAfU1YGUlUgh2UNkFWBvzGCO5X3r3OQq\r\nku5nykQSFXkMPQMB1a6f2EyNr8rHYLx26qg=\r\n=BKol\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ad113n","email":"ad113n@att.com"},"maintainers":[{"name":"ad113n","email":"ad113n@att.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opencv-wasm-sync_4.7.0_1682082570217_0.2456201140814096"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-21T13:09:30.141Z","4.7.0":"2023-04-21T13:09:30.511Z","modified":"2023-04-21T13:09:30.751Z"},"maintainers":[{"name":"ad113n","email":"ad113n@att.com"}],"description":"Precompiled OpenCV 4.7.0 to JavaScript + WebAssembly for node.js environment","homepage":"https://github.com/echamudi/opencv-wasm#readme","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"}