augment-nodejs

1.0.1 • Public • Published

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


A simple and flexible npm library that helps to creates augmentation images for Deep Learning Applications.
Implement with opencv4nodejs.

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.

/augment-nodejs/

    Package Sidebar

    Install

    npm i augment-nodejs

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    6.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • jayasundara