Skip to content

Commit

Permalink
feat(mediapipe): add lightweight opencv package
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyuanZhang committed Jan 25, 2021
1 parent 8e2811f commit 8ee48ae
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/*.d.ts
node_modules
packages/paddlejs-enc/**/*
packages/paddlejs-mediapipe/opencv/**/*
33 changes: 33 additions & 0 deletions packages/paddlejs-mediapipe/opencv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[中文版](./README_cn.md)

# opencv_blur.js

A lightweight npm package which just includes modules **core imgproc js video**.

# modules
OpenCV modules:
-- To be built: **core imgproc js video**
-- Disabled: calib3d dnn features2d flann highgui imgcodecs ml photo stitching videoio world
-- Disabled by dependency: objdetect
-- Unavailable: gapi java python2 python3 ts
-- Applications: -
-- Documentation: js
-- Non-free algorithms: NO


# npm

```bash
npm install @paddlejs-mediapipe/opencv
```

# Usage

```javascript
import cv from '@paddlejs-mediapipe/opencv/library/opencv_blur';
let logit = cv.imread('canvas');
let dst = new cv.Mat();
let ksize = new cv.Size(5, 5);
let anchor = new cv.Point(-1, -1);
cv.blur(logit, dst, ksize, anchor, cv.BORDER_DEFAULT);
```
28 changes: 28 additions & 0 deletions packages/paddlejs-mediapipe/opencv/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[English](./README.md)

# opencv_blur.js

一个轻量级 opencv 库,目前包含模块 **core imgproc js video**,主要用于边缘模糊处理。

# 模块

OpenCV 模块:
-- 包含: **core imgproc js video**
-- 禁用: calib3d dnn features2d flann highgui imgcodecs ml photo stitching videoio world

# npm

```bash
npm install @paddlejs-mediapipe/opencv
```

# Usage

```javascript
import cv from '@paddlejs-mediapipe/opencv/library/opencv_blur';
let logit = cv.imread('canvas');
let dst = new cv.Mat();
let ksize = new cv.Size(5, 5);
let anchor = new cv.Point(-1, -1);
cv.blur(logit, dst, ksize, anchor, cv.BORDER_DEFAULT);
```
48 changes: 48 additions & 0 deletions packages/paddlejs-mediapipe/opencv/library/opencv_blur.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions packages/paddlejs-mediapipe/opencv/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@paddlejs-mediapipe/opencv",
"version": "0.0.1",
"description": "lightweight opencv.js",
"main": "library/",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"opencv", "blur", "core"
],
"author": "",
"license": "ISC"
}
7 changes: 7 additions & 0 deletions packages/paddlejs-mediapipe/opencv/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../tsconfig",
"include": [],
"exclude": [
"library/*.js"
]
}

0 comments on commit 8ee48ae

Please sign in to comment.