Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@u4/opencv-build

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@u4/opencv-build

A simple script to auto build recent OpenCV + contrib version via npm 2021 Edition

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
665
decreased by-34.61%
Maintainers
1
Weekly downloads
 
Created
Source

npm-opencv-build

Build Status Build status

A simple script to auto build recent OpenCV + contrib version via npm. This script is used to auto build opencv4nodejs.

Changes in this fork

  • OpenCV build is not triggered by npm install but by new OpenCVBuilder().install()
  • OpenCV build can now be configured with new OpenCVBuilder(new OpenCVBuildEnv({version: "3.4.16", autoBuildBuildCuda: true, autoBuildWithoutContrib: false, })).install()
  • Each OPENCV_VERSION will be build in his own directory.
  • Each AUTOBUILD_FLAGS will be build in his own directory. (induce massive time gain during development)
  • Script output is now colorized.
  • Add some usefull log.
  • Big code refactor.
  • Enfoce typing.
  • Add comments and documentations.

Install

npm install opencv-build

Requirements

  • cmake

Windows

for old nodejs

npm install --global windows-build-tools

Environment Variables

It's possible to specify build environment variables by inserting them into the package.json where the dependency is declared an object like:

{
  "opencv4nodejs": {
    "autoBuildFlags": "-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_PC_FILE_NAME=opencv.pc",
    "autoBuildOpencvVersion": "4.5.4"
  }
}

The following opencv4nodejs parameters can be passed:

autoBuildBuildCuda

Can be set using the environment variables OPENCV4NODEJS_BUILD_CUDA

set any value to enable, the following cMake flag will be added:

  • DWITH_CUDA=ON
  • DBUILD_opencv_cudacodec=OFF // video codec (NVCUVID) is deprecated in cuda 10, so don't add it
  • DCUDA_FAST_MATH=ON // optional
  • DWITH_CUBLAS=ON // optional

autoBuildFlags

Can be set using the environment variables OPENCV4NODEJS_AUTOBUILD_FLAGS

Append option to CMake flags.

autoBuildOpencvVersion

Can be set using the environment variables OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION

Choose the openCV version you want to build default value is 3.4.16.

autoBuildWithoutContrib

Can be set using the environment variables OPENCV4NODEJS_AUTOBUILD_WITHOUT_CONTRIB

Set any value to enable, this option will skip openCV Contribs.

disableAutoBuild

Can be set using the environment variables OPENCV4NODEJS_DISABLE_AUTOBUILD

Set any value to disable compilation from sources.

opencvIncludeDir

Over write the OPENCV_INCLUDE_DIR environment variables

opencvLibDir

Over write the OPENCV_LIB_DIR environment variables

opencvBinDir

Over write the OPENCV_BIN_DIR environment variables

build test

OPENCV4NODEJS_AUTOBUILD_FLAGS=-DBUILD_LIST=core,imgproc,imgcodecs,videoio,highgui,video,calib3d,features2d,objdetect,dnn,ml,flann,photo,stitching,gapi
npm run build && OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION=3.4.15 OPENCV4NODEJS_AUTOBUILD_WITHOUT_CONTRIB=1 npm run do-install
npm run build && OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION=4.5.4 OPENCV4NODEJS_AUTOBUILD_WITHOUT_CONTRIB=1 npm run do-install

Keywords

FAQs

Package last updated on 27 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc