{"id":23499668,"url":"https://github.com/techstark/opencv-js","last_synced_at":"2026-01-21T11:05:25.113Z","repository":{"id":44464777,"uuid":"338342440","full_name":"TechStark/opencv-js","owner":"TechStark","description":"OpenCV JavaScript version for node.js or browser","archived":false,"fork":false,"pushed_at":"2025-04-04T13:58:52.000Z","size":30702,"stargazers_count":538,"open_issues_count":31,"forks_count":47,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T03:48:00.499Z","etag":null,"topics":["js","npm-package","opencv"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@techstark/opencv-js","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechStark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-12T14:31:30.000Z","updated_at":"2025-04-07T09:10:45.000Z","dependencies_parsed_at":"2023-10-11T06:38:57.173Z","dependency_job_id":"32714209-ea8a-4ce5-9bfc-0d380c566f09","html_url":"https://github.com/TechStark/opencv-js","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechStark%2Fopencv-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechStark%2Fopencv-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechStark%2Fopencv-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechStark%2Fopencv-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechStark","download_url":"https://codeload.github.com/TechStark/opencv-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149975,"owners_count":22022852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["js","npm-package","opencv"],"created_at":"2024-12-25T06:18:18.097Z","updated_at":"2026-01-21T11:05:25.108Z","avatar_url":"https://github.com/TechStark.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opencv-js\n\nOpenCV JavaScript version (NPM package) for node.js or browser. Get started guide [OpenCV.js Tutorials](https://docs.opencv.org/4.12.0/#:~:text=OpenCV%2DPython%20Tutorials-,OpenCV.js%20Tutorials,-Tutorials%20for%20contrib).\n\nThe file `opencv.js` was downloaded from https://docs.opencv.org/4.12.0/opencv.js\n\nTypeScript is supported (thanks to `mirada`).\n\n# Basic Usage\n\n```js\nimport cvModule from \"@techstark/opencv-js\";\n\nasync function getOpenCv() {\n  let cv;\n  if (cvModule instanceof Promise) {\n    cv = await cvModule;\n  } else {\n    if (cvModule.Mat) {\n      cv = cvModule;\n    } else {\n      await new Promise((resolve) =\u003e {\n        cvModule.onRuntimeInitialized = () =\u003e resolve();\n      });\n      cv = cvModule;\n    }\n  }\n  return { cv };\n}\n\nasync function main() {\n  const { cv } = await getOpenCv();\n  console.log(\"OpenCV.js is ready!\");\n  // You can now use OpenCV functions here\n  console.log(cv.getBuildInformation());\n}\n\nmain();\n```\n\n# Code Examples\n\n- See code examples (React, Angular, Node.js) in [opencv-js-examples](https://github.com/TechStark/opencv-js-examples)\n\n# Live Demo\n\n## Using in react.js project\n\n- See [live demo and code here](https://codesandbox.io/s/techstarkopencv-js-demo-page-f7gvk?file=/src/TestPage.jsx)\n  \u003cimg src=\"https://user-images.githubusercontent.com/132509/130320696-eaa3899b-2356-4e9f-bbc9-0a969465c58e.png\" height=\"800px\" alt=\"Live demo screenshot\" /\u003e\n- Get the test image from here [Lenna.png](test/Lenna.png)\n\n## Using in Angular project\n\n- See [code here](https://codesandbox.io/s/techstark-opencv-js-angular-demo-hkmc1n?file=/src/app/app.component.ts)\n\n## Real-time face detection\n\n- See [live demo and code here](https://codesandbox.io/s/opencv-js-face-detection-i1i3u)\n\n![Real-time face detection](https://user-images.githubusercontent.com/132509/160820773-cdb023a6-77a2-4f2e-a0e9-fb06931c8f9f.gif)\n\n# How to Use\n\n- `npm install @techstark/opencv-js`\n- or `yarn add @techstark/opencv-js`\n- `import cv from \"@techstark/opencv-js\"`\n  - for TypeScript, set `\"esModuleInterop\": true` in `tsconfig.json`\n- or `import * as cv from \"@techstark/opencv-js\"`\n\n# Webpack Configuration (for browser usage)\n\nIf you use this package for browsers, you need to set some polyfills. In the file \"webpack.config.js\", set\n\n```js\nmodule.exports = {\n  resolve: {\n    modules: [...],\n    fallback: {\n      fs: false,\n      path: false,\n      crypto: false\n    }\n  }\n};\n```\n\n# What methods and properties are available\n\nThe TypeScript type declarations may not be up to date with the latest OpenCV.js. Refer to [cvKeys.json](doc/cvKeys.json) to check the available methods and properties at runtime.\n\n# Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=techstark/opencv-js\u0026type=Date)](https://star-history.com/#techstark/opencv-js\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechstark%2Fopencv-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechstark%2Fopencv-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechstark%2Fopencv-js/lists"}