Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justadudewhohacks/opencv-electron
Example for using opencv4nodejs with electron.
https://github.com/justadudewhohacks/opencv-electron
electron javascript node nodejs opencv react reactjs webpack
Last synced: 3 months ago
JSON representation
Example for using opencv4nodejs with electron.
- Host: GitHub
- URL: https://github.com/justadudewhohacks/opencv-electron
- Owner: justadudewhohacks
- License: mit
- Created: 2017-10-03T06:57:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T03:14:25.000Z (almost 6 years ago)
- Last Synced: 2024-10-13T08:51:13.755Z (4 months ago)
- Topics: electron, javascript, node, nodejs, opencv, react, reactjs, webpack
- Language: HTML
- Size: 788 KB
- Stars: 144
- Watchers: 12
- Forks: 39
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
opencv-electron
==============
**This is an example of how to use [opencv4nodejs](https://github.com/justadudewhohacks/opencv4nodejs) with electron to build cross-platform desktop apps.**![opencv-electron](https://user-images.githubusercontent.com/31125521/31113188-51e7c6d8-a818-11e7-9015-295d1864e1d6.jpg)
Note that there is an additional npm script to rebuild the package for electron, which is called from the install script:
```
"electron-rebuild": "electron-rebuild -w opencv4nodejs"
```# plain-js
This example shows how to use opencv4nodejs with electron and plain HTML + Javascript without any bundler.## Running this example:
### Set up opencv4nodejs, electron and rebuild the module for electron:
``` bash
npm install
```### Run:
``` bash
npm start
```# webpack-reactjs
This example shows how to use opencv4nodejs with webpack and react, requires node-loader to load the native addon.
``` bash
npm i node-loader
```## On windows
If you are using the autobuild on windows, you have to append the path to the binaries
to the path env of main process manually as follows (in main.js):
```
if (process.platform === 'win32' && !process.env.OPENCV4NODEJS_DISABLE_AUTOBUILD) {
process.env.path += ';' + require('../renderer/node_modules/opencv-build').opencvBinDir
}
```## Running this example:
In the root directory:
``` bash
npm install
npm start
```In another terminal cd into ./renderer and run the dev server:
``` bash
npm install
npm start
```# Known issues
If you are receiving the following error on windows during electron-rebuild:
``` bash
AttributeError: 'MSVSProject' object has no attribute 'iteritems'
```Delete fsevents from your node_modules folder and rerun:
```
npm run electron-rebuild
```