
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
opencv-napi
Advanced tools
High-performance Node.js NAPI bindings for OpenCV 4.12.0 - Complete Computer Vision Library
一个基于 Node-API 的高性能 OpenCV 4.12.0 绑定库,提供完整的计算机视觉功能接口。
npm install opencv-napi
如果预编译的二进制文件不适用于您的平台,可以尝试从源码构建:
# 安装并自动构建
npm install
# 或者手动构建
npm run build
const opencv = require('opencv-napi');
// 查看版本信息
console.log('OpenCV 版本:', opencv.version);
console.log('可用模块:', opencv.modules);
// 获取系统信息
console.log('构建信息:', opencv.getBuildInformation());
console.log('线程数:', opencv.getNumThreads());
// 基础图像操作
const image = opencv.imread('input.jpg');
const resized = opencv.resize(image, { width: 800, height: 600 });
opencv.imwrite('output.jpg', resized);
Core 模块 (8个函数):
getBuildInformation, getNumThreads, setNumThreadsgetVersionMajor, getVersionMinor, getVersionRevisionadd, subtract, multiply, dividebitwiseAnd, bitwiseOr, bitwiseXor, bitwiseNotaddWeighted, minMaxLoc, minMaxIdxtranspose, determinant, trace, invertflip, copyMakeBorderdft, idft, dct, idctImgProc 模块 (3个函数):
blur - 图像模糊gaussianBlur - 高斯模糊resize - 图像缩放ImgCodecs 模块 (2个函数):
imread - 读取图像imwrite - 保存图像所有其他 OpenCV 函数都已实现占位符,会抛出"尚未实现"错误,为后续具体实现提供完整框架。
opencv.version - 版本对象 {major, minor, revision}opencv.modules - 可用模块列表opencv.getBuildInformation() - 获取构建信息opencv.getVersionMajor() - 获取主版本号opencv.getVersionMinor() - 获取次版本号opencv.getVersionRevision() - 获取修订版本号opencv.getNumThreads() - 获取线程数opencv.setNumThreads(threads) - 设置线程数opencv.imread(filename) - 读取图像文件opencv.imwrite(filename, image, options) - 保存图像到文件opencv.blur(image, kernelSize) - 图像模糊opencv.gaussianBlur(image, kernelSize, sigmaX) - 高斯模糊opencv.resize(image, size) - 调整图像尺寸opencv-napi/
├── src/ # 源代码
│ ├── addon.cpp # Node-API 绑定入口
│ └── napi_opencv/ # OpenCV 模块绑定
│ ├── core/ # Core 模块
│ ├── imgproc/ # ImgProc 模块
│ ├── imgcodecs/ # ImgCodecs 模块
│ ├── objdetect/ # ObjDetect 模块
│ ├── features2d/ # Features2d 模块
│ ├── photo/ # Photo 模块
│ ├── calib3d/ # Calib3d 模块
│ ├── flann/ # Flann 模块
│ ├── videoio/ # Videoio 模块
│ └── gapi/ # Gapi 模块
├── lib/ # TypeScript 接口
├── docs/ # 文档
├── examples/ # 示例代码
├── test/ # 测试文件
└── deps/ # 依赖库
└── OpenCV-Source/ # OpenCV 源码
# 安装依赖
npm install
# 构建原生模块
npm run build
# 清理构建文件
npm run clean
# 交叉编译所有平台
npm run cross-compile:all
# 验证交叉编译结果
npm run cross-compile:verify
# 运行测试
npm test
# 运行详细测试
npm run test:run
我们欢迎社区贡献!请查看 CONTRIBUTING.md 了解详细信息。
OpenCV NAPI 在图像处理性能方面表现出色:
构建失败
运行时错误
性能问题
MIT License - 详见 LICENSE 文件。
为计算机视觉和 Node.js 社区用心制作 ❤️
FAQs
High-performance Node.js NAPI bindings for OpenCV 4.12.0 - Complete Computer Vision Library
We found that opencv-napi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.