初次提交

This commit is contained in:
2025-03-17 10:19:27 +08:00
commit 6c29336660
22 changed files with 1461 additions and 0 deletions

39
README.md Normal file
View File

@ -0,0 +1,39 @@
# @yizhi/opencv
简单的OpenCV封装
## 编译源码
1. 依赖
1. python3
1. cmake
1. ninja
1. c++编译器(gcc,clang,Visual Studio ...)
1. 编译OpenCV
```bash
node thirdpart/install.js --with-opencv
```
1. 编译本模块
```bash
cmake -B build -G Ninja . -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
```
## 安装
```bash
npm install @yizhi/opencv
```
## 使用
```typescript
//导入opencv
import cv from '@yizhi/opencv';
//配置addon路径
cv.config("ADDON_PATH", "/path/to/cv.node");
//正常使用
const im = cv.imread("/path/to/input");
cv.resize(im, 640, 640);
cv.imwrite("/path/to/output", im);
```