1.0.1 • Published 3 years ago

augment-nodejs v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Basic image augmentation Node.js library for machine learning in Javascript

Installation

npm i augment-nodejs --save npm i opencv4nodejs --save

Import

const cv = require("opencv4nodejs");
var aug = require("augment-nodejs")(cv);

Example

const cv = require("opencv4nodejs");
const aug = require("augment-nodejs")(cv);

const image = cv.imread("lenna.jpg");

const augimg = aug.flip(image);

cv.imshowWait("", augimg);

API

blur

Return, blured image

aug.blur(img, kernalSize, stddev);

kernalSize - odd number
stddev - number

intensity

Return, darked or brighted image

aug.intensity(img, alpha, beta);

alpha - number
beta - number

flip

Return, fliped image

aug.flip(img);

gray

Return, grayed image

aug.gray(img);

rotate

Return, rotated image

aug.rotate(img, angle);

angle - number

zoom

Return, zoomed image

const roi = { x0: 0.3, y0: 0.3, x1: 0.8 , y1: 0.8}

aug.zoom(img, roi);

crop

Return, croped image

const roi = { x0: 0.3, y0: 0.3, x1: 0.8 , y1: 0.8}

aug.crop(img, roi);

padding

Return, padded image

aug.padding(img, padHeight, padWidth, centerContent);

centerContent - boolean
padHeight - number
padWidth - number

Contributing

You can contribute to this project. You just need to create a pull request which will be revised, merged to main branch (if the code doesn't break the project) and published as a new release.