Socket
Book a DemoInstallSign in
Socket

augment-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

augment-nodejs

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

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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
  • intensity
  • flip
  • gray
  • rotate
  • zoom
  • crop
  • padding

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.

Keywords

image

FAQs

Package last updated on 17 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.