You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-351Lines changed: 8 additions & 351 deletions
Original file line number
Diff line number
Diff line change
@@ -205,357 +205,14 @@ The following environment variables can be passed:
205
205
- opencvLibDir
206
206
- opencvBinDir
207
207
208
-
<aname="usage-with-docker"></a>
208
+
## Disabeling installation of prebuilt OpenCV
209
209
210
-
# Usage with Docker
211
-
212
-
### [opencv-express](https://github.com/justadudewhohacks/opencv-express) - example for opencv4nodejs with express.js and docker
213
-
214
-
Or simply pull from [justadudewhohacks/opencv-nodejs](https://hub.docker.com/r/justadudewhohacks/opencv-nodejs/) for opencv-3.2 + contrib-3.2 with opencv4nodejs globally installed:
215
-
216
-
```docker
217
-
FROM justadudewhohacks/opencv-nodejs
218
-
```
219
-
220
-
**Note**: The aforementioned Docker image already has ```opencv4nodejs``` installed globally. In order to prevent build errors during an ```npm install```, your ```package.json``` should not include ```opencv4nodejs```, and instead should include/require the global package either by requiring it by absolute path or setting the ```NODE_PATH``` environment variable to ```/usr/lib/node_modules``` in your Dockerfile and requiring the package as you normally would.
221
-
222
-
Different OpenCV 3.x base images can be found here: https://hub.docker.com/r/justadudewhohacks/.
223
-
224
-
<aname="usage-with-electron"></a>
225
-
226
-
# Usage with Electron
227
-
228
-
### [opencv-electron](https://github.com/justadudewhohacks/opencv-electron) - example for opencv4nodejs with electron
Any native modules, including opencv4nodejs, must be recompiled to be used with [NW.js](https://nwjs.io/). Instructions on how to do this are available in the **[Use Native Modules](http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/)** section of the the NW.js documentation.
250
-
251
-
Once recompiled, the module can be installed and required as usual:
The async API can be consumed by passing a callback as the last argument of the function call. By default, if an async method is called without passing a callback, the function call will yield a Promise.
Check out the TypeScript [examples](https://github.com/justadudewhohacks/opencv4nodejs/tree/master/examples/typed).
543
-
544
-
<aname="external-mem-tracking"></a>
545
-
546
-
# External Memory Tracking (v4.0.0)
547
-
548
-
Since version 4.0.0 was released, external memory tracking has been enabled by default. Simply put, the memory allocated for Matrices (cv.Mat) will be manually reported to the node process. This solves the issue of inconsistent Garbage Collection, which could have resulted in spiking memory usage of the node process eventually leading to overflowing the RAM of your system, prior to version 4.0.0.
549
-
550
-
Note, that in doubt this feature can be **disabled** by setting an environment variable `OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING` before requiring the module:
210
+
By default opencv4nodejs-prebuilt will install a prebuilt version of OpenCV for the current platform via @nut-tree/opencv-build-(win32/linux/darwin).
211
+
If you want to disable this behaviour (to e.g. provide your own OpenCV build), set the following environment variable:
551
212
552
213
```bash
553
-
export OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING=1 // linux
554
-
set OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING=1 // windows
0 commit comments