From c1659d6996b099fa1674cc2a07e6ea31c722b21a Mon Sep 17 00:00:00 2001 From: Devavrat Kalam Date: Sat, 3 Aug 2019 05:05:54 -0400 Subject: [PATCH] Alphabetically arranged the MODULES.md file #1167 - Sorted index and the corpus (#1186) * Sorted index and the corpus * Changed text overlay sequence --- docs/MODULES.md | 373 ++++++++++++++++++++++++------------------------ 1 file changed, 189 insertions(+), 184 deletions(-) diff --git a/docs/MODULES.md b/docs/MODULES.md index b4baeecdfc..39ebd9ad5b 100644 --- a/docs/MODULES.md +++ b/docs/MODULES.md @@ -3,119 +3,49 @@ Documentation of various Modules List of Module Documentations -1. [Crop](#crop-module) -2. [Segmented-Colormap](#segmented-colormap-module) -3. [FisheyeGl](#fisheyeGl-module) -4. [Add QR](#Add-QR-module) -5. [Average](#average-module) -6. [Blend](#blend-module) -7. [Blob-Analysis](#blob-analysis) -7. [Blur](#blur-module) -8. [Brightness](#brightness-module) -9. [Channel](#channel-module) -10. [Colorbar](#colorbar-module) -11. [Colormap](#colormap-module) -12. [Contrast](#contrast-module) -13. [Convolution](#convolution-module) -14. [DecodeQr](#decodeQr-module) -15. [Dither](#dither-module) -16. [DrawRectangle](#draw-rectangle-module) -17. [Dynamic](#dynamic-module) -18. [Edge-Detect](#edge-detect-module) +1. [Add QR](#Add-QR-module) +2. [Average](#average-module) +3. [Blend](#blend-module) +4. [Blur](#blur-module) +5. [Brightness](#brightness-module) +6. [Channel](#channel-module) +7. [Colorbar](#colorbar-module) +8. [Colormap](#colormap-module) +9. [ColorTemperature](#color-temperature) +10. [Contrast](#contrast-module) +11. [Convolution](#convolution-module) +12. [Crop](#crop-module) +13. [DecodeQr](#decodeQr-module) +14. [Dither](#dither-module) +15. [DrawRectangle](#draw-rectangle-module) +16. [Dynamic](#dynamic-module) +17. [Edge-Detect](#edge-detect-module) +18. [FisheyeGl](#fisheyeGl-module) 19. [FlipImage](#flipimage-module) 20. [Gamma-Correction](#gamma-correction-module) 21. [Gradient](#gradient-module) -22. [Histogram](#histogram-module) -23. [Import-image](#import-image-module) -24. [Invert](#invert-module) -25. [Ndvi](#ndvi-module) -26. [Ndvi-Colormap](#ndvi-colormap-module) -27. [Overlay](#overlay-module) -28. [PaintBucket](#paint-bucket-module) -29. [Resize](#resize-module) -30. [ReplaceColor](#replacecolor-module) -31. [Rotate](#rotate-module) -32. [Saturation](#saturation-module) -33. [Threshold](#threshold) -34. [Tint](#tint) -35. [ColorTemperature](#color-temperature) -36. [Grid-Overlay](#grid-overlay) -37. [MinifyImage](#minify-image) -38. [Text-Overlay](#text-overlay) +22. [Grid-Overlay](#grid-overlay) +23. [Histogram](#histogram-module) +24. [Import-image](#import-image-module) +25. [Invert](#invert-module) +26. [MinifyImage](#minify-image) +27. [Ndvi](#ndvi-module) +28. [Ndvi-Colormap](#ndvi-colormap-module) +29. [Overlay](#overlay-module) +30. [PaintBucket](#paint-bucket-module) +31. [ReplaceColor](#replacecolor-module) +32. [Resize](#resize-module) +33. [Rotate](#rotate-module) +34. [Saturation](#saturation-module) +35. [Segmented-Colormap](#segmented-colormap-module) +36. [Text-Overlay](#text-overlay) +37. [Threshold](#threshold) +38. [Tint](#tint) -## crop-module - -This module is used to crop an image. - -#### Usage - -```js - sequencer.loadImage('PATH') - .addSteps('crop',options) - .run(); -``` -Where `options` is an object having the properties `x`, `y`, `w`, `h`. This diagram defines these properties: - -![Image](CropManual.png) - -#### Defaults - -* `options.x` : 0 -* `options.y` : 0 -* `options.w` : half of image width -* `options.h` : half of image height - - -## segmented-colormap-module - -This module is used to map the pixels of the image to a segmented colormap. - -#### Usage - -```js - sequencer.loadImage('PATH') - .addSteps('segmented-colormap',options) - .run() -``` - -where `options` is an object with the property `colormap`. `options.colormap` can be: - -* "default" : [[0, [0, 0, 255], [38, 195, 195]], [0.5, [0, 150, 0], [255, 255, 0]], [0.75, [255, 255, 0], [255, 50, 50]]] - -* "greyscale" : [[0, [0, 0, 0], [255, 255, 255]], [1, [255, 255, 255], [255, 255, 255]]] - -* "stretched" : [[0, [0, 0, 255], [0, 0, 255]], [0.1, [0, 0, 255], [38, 195, 195]], [0.5, [0, 150, 0], [255, 255, 0]], [0.7, [255, 255, 0], [255, 50, 50]], [0.9, [255, 50, 50], [255, 50, 50]]] - -* "fastie" : [[0, [255, 255, 255], [0, 0, 0]], [0.167, [0, 0, 0], [255, 255, 255]], [0.33, [255, 255, 255], [0, 0, 0]], [0.5, [0, 0, 0], [140, 140, 255]], [0.55, [140, 140, 255], [0, 255, 0]], [0.63, [0, 255, 0], [255, 255, 0]], [0.75, [255, 255, 0], [255, 0, 0]], [0.95, [255, 0, 0], [255, 0, 255]]] - -* A custom array. - -## fisheyeGl-module - -This module is used for correcting Fisheye or Lens Distortion - -#### Usage - -```js - sequencer.loadImage('PATH') - .addSteps('fisheye-gl',options) - .run() -``` - -where `options` is an object with the following properties: -* a : a correction (0 to 4; default 1) -* b : b correction (0 to 4; default 1) -* Fx : x correction (0 to 4; default 1) -* Fy : y correction (0 to 4; default 1) -* scale : The ratio to which the original image is to be scaled (0 to 20; default 1.5) -* x : Field of View x (0 to 2; default 1) -* y : Field of View y (0 to 2; default 1) - ## add-qr-module This module Adds QR corresponding to the given string. - #### Usage ```js @@ -132,7 +62,6 @@ where `options` is an object with the following properties: ## average-module This module is used for averaging all the pixels of the image. - #### Usage ```js @@ -141,6 +70,7 @@ This module is used for averaging all the pixels of the image. .run() ``` + ## blend-module This module is used for blending two images . @@ -184,11 +114,10 @@ This module is used for applying a Gaussian blur effect. where `options` is an object with the following property: * blur : Intensity of Gaussian blur (0 to 5; default 2) + ## brightness-module This module is used for changing the brightness of the image. - - #### Usage ```js @@ -200,10 +129,10 @@ This module is used for changing the brightness of the image. where `options` is an object with the following property: * brightness : brightness of the image in percentage (0 to 100; default 100) + ## channel-module This module is used for forming a grayscale image by applying one of the three primary colors. - #### Usage ```js @@ -215,10 +144,10 @@ This module is used for forming a grayscale image by applying one of the three p where `options` is an object with the following property: * channel : color of the channel (red, green, blue; default green) + ## colorbar-module This module is used for displaying an image with a colorbar. - #### Usage ```js @@ -233,10 +162,10 @@ where `options` is an object with the following properties: * y : Y-position of the image on which the new image is overlayed (default 0) * h : height of resulting cropped image (default : 50% of input image width ) + ## colormap-module This module is used for mapping brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients. - #### Usage ```js @@ -248,10 +177,24 @@ This module is used for mapping brightness values (average of red, green & blue) where `options` is an object with the following property: * colormap : Name of the Colormap ( greyscale, stretched, fastie, brntogrn, blutoredjet, colors16) + +## Color Temperature + +This changes the color temperature of the image. +## Usage + +```js + sequencer.loadImage('PATH') + .addSteps('color-temperature',options) + .run() +``` +where `options` is an object with the following property: +* temperature : temperature between 0 - 40,000 kelvin (default 6000) + + ## contrast-module This module is used for changing the contrast of the image. - #### Usage ```js @@ -263,10 +206,10 @@ This module is used for changing the contrast of the image. where `options` is an object with the following property: * contrast : contrast for the given image (-100 to 100; default : 70) + ## convolution-module This module is used for performing image-convolution. - #### Usage ```js @@ -279,10 +222,32 @@ where `options` is an object with the following properties: * constantFactor : a constant factor, multiplies all the kernel values by that factor (default : 1/9) * kernelValues : nine space separated numbers representing the kernel values in left to right and top to bottom format(default : 1 1 1 1 1 1 1 1 1) + +## crop-module + +This module is used to crop an image. +#### Usage + +```js + sequencer.loadImage('PATH') + .addSteps('crop',options) + .run(); +``` +Where `options` is an object having the properties `x`, `y`, `w`, `h`. This diagram defines these properties: + +![Image](CropManual.png) + +#### Defaults + +* `options.x` : 0 +* `options.y` : 0 +* `options.w` : half of image width +* `options.h` : half of image height + + ## decodeQr-module This module is used for decoding a QR in image (if present). - #### Usage ```js @@ -296,8 +261,7 @@ This module is used for decoding a QR in image (if present). This module approximates a color from a mixture of other colors when the required color is not available, creating illusions of the color that is not present actually. [more info on wikipedia](https://en.wikipedia.org/wiki/Dither) - -## Usage +#### Usage ```js sequencer.loadImage('PATH') @@ -307,10 +271,10 @@ This module approximates a color from a mixture of other colors when the require where `options` is an object with the following property: * dither : Can select the name of the Dithering Algorithm(default none) + ## draw-rectangle-module This module helps to draw a rectangle on the image with a starting and ending corner with the specified thickness and color of the border. - ## Usage ```js @@ -326,10 +290,10 @@ where `options` is an object with the following properties: * thickness : thickness of the border (default 1) * color : RGBA values separated by a space (default "0 0 0 255") + ## dynamic-module This module is used for producing each color channel based on the original image's color. - #### Usage ```js @@ -344,6 +308,7 @@ where `options` is an object with the following properties: * blue : expression for blue channel (R, G, B and A as inputs; default b) * monochrome: fallback for other channels if none provided (default : r+g+b/3) + ## edge-detect-module This module is used for detecting images. @@ -360,12 +325,33 @@ where `options` is an object with the following properties: * highThresholdRatio : Upper Threshold Ratio ( default : 0.2) * lowThresholdratio : Lower Threshold Ratio ( default : 0.2) + +## fisheyeGl-module + +This module is used for correcting Fisheye or Lens Distortion +#### Usage + +```js + sequencer.loadImage('PATH') + .addSteps('fisheye-gl',options) + .run() +``` + +where `options` is an object with the following properties: +* a : a correction (0 to 4; default 1) +* b : b correction (0 to 4; default 1) +* Fx : x correction (0 to 4; default 1) +* Fy : y correction (0 to 4; default 1) +* scale : The ratio to which the original image is to be scaled (0 to 20; default 1.5) +* x : Field of View x (0 to 2; default 1) +* y : Field of View y (0 to 2; default 1) + + ## flipimage-module This module is used for flipping the image on the selected axis. #### Usage - ```js sequencer.loadImage('PATH') .addSteps('flip-image',options) @@ -390,6 +376,7 @@ This module is used for applying gamma correction. where `options` is an object with the following property: * adjustment : Inverse of actual gamma factor (default 0.2) + ## gradient-module This module is used for finding gradient of the image. @@ -401,6 +388,23 @@ This module is used for finding gradient of the image. .run() ``` + +## Grid Overlay + +This adds the grid over an image. +## Usage + +```js + sequencer.loadImage('PATH') + .addSteps('grid-overlay',options) + .run() +``` +where `options` is an object with the following property: +* options.x : The value at which the grid line should start in x-axis. +* options.y : The value at which the grid line should start in y-axis. +* color : Color for the grid on the image. + + ## histogram-module This module is used for calculating histogram of the image. @@ -415,6 +419,7 @@ This module is used for calculating histogram of the image. where `options` is an object with the following property: * gradient : boolean value used to toggle gradient along x-axis (true or false; default true) + ## import-image-module This module is used for importing a new image and replacing the original with it. @@ -429,6 +434,7 @@ This module is used for importing a new image and replacing the original with it where `options` is an object with the following property: * url : url of the new image (local image url or data url;default : "./images/monarch.png") + ## invert-module This module is used for inverting the image. @@ -440,6 +446,21 @@ This module is used for inverting the image. .run() ``` + +## Minify Image + +This module minifies the image using lossy compression that is the image-dimensions are not lost but the size is reduced. + +The module supports jpg/jpeg/webp images in browser; but the node version supports all of the types. +#### Usage + +```js +sequencer.loadImage('PATH') + .addSteps('minify-image') + .run() +``` + + ## ndvi-module This module is used for applying ndvi technique to the image. @@ -454,6 +475,7 @@ This module is used for applying ndvi technique to the image. where `options` is an object with the following property: * filter : filter for NDVI (blue or red; default red) + ## ndvi-colormap-module This module is used for demonstrating ndvi and colormap properties consecutively. @@ -465,6 +487,7 @@ This module is used for demonstrating ndvi and colormap properties consecutively .run() ``` + ## overlay-module This module is used for overlaying an Image over another . @@ -481,10 +504,10 @@ where `options` is an object with the following properties: * y : Y-position of the image on which the new image is overlayed (default 0) * offset : offset to the step on which the output of the last step is overlayed (default -2) + ## paint-bucket-module This module fills any polygonal shape with the specified color in pixels. - ## Usage ```js @@ -499,19 +522,6 @@ where `options` is an object with the following property: * fillColor : they are four spaced seperated numbers representing the RGBA values of fill-color (default "100 100 100 255") * tolerance : it is the % tolerance (default 10) -## resize-module - -This module is used for resizing an image. -#### Usage - -```js - sequencer.loadImage('PATH') - .addSteps('resize',options) - .run() -``` - -where `options` is an object with the following property: -* resize : Percentage value of resize (default 125%) ## replacecolor-module @@ -529,6 +539,22 @@ where `options` is an object with the following properties: * color : three space separated numbers representing the RGB values of color to be replaced (default "228 86 81") * tolerance : it is the % tolerance (default 50) + +## resize-module + +This module is used for resizing an image. +#### Usage + +```js + sequencer.loadImage('PATH') + .addSteps('resize',options) + .run() +``` + +where `options` is an object with the following property: +* resize : Percentage value of resize (default 125%) + + ## rotate-module This module is used for rotating an image. @@ -543,6 +569,7 @@ This module is used for rotating an image. where `options` is an object with the following property: * rotate : angular value for rotation in degrees (between 0 and 360; default 0) + ## saturation-module This module is used for changing the saturation of the image. @@ -557,92 +584,70 @@ This module is used for changing the saturation of the image. where `options` is an object with the following property: * saturation : saturation for the new image (between 0 and 2; default 0) -## Threshold -Thresholding is used to create binary images. +## segmented-colormap-module -## Usage +This module is used to map the pixels of the image to a segmented colormap. +#### Usage ```js sequencer.loadImage('PATH') - .addSteps('threshold',options) + .addSteps('segmented-colormap',options) .run() ``` -where `options` is an object with the following property: -* threshold : it allows to select the types of thresholding (default "manual thresholding") -* input : it allows to select the range of thresholding value (default 120) +where `options` is an object with the property `colormap`. `options.colormap` can be: -## Tint +* "default" : [[0, [0, 0, 255], [38, 195, 195]], [0.5, [0, 150, 0], [255, 255, 0]], [0.75, [255, 255, 0], [255, 50, 50]]] -It adds color tint to an image +* "greyscale" : [[0, [0, 0, 0], [255, 255, 255]], [1, [255, 255, 255], [255, 255, 255]]] -## Usage +* "stretched" : [[0, [0, 0, 255], [0, 0, 255]], [0.1, [0, 0, 255], [38, 195, 195]], [0.5, [0, 150, 0], [255, 255, 0]], [0.7, [255, 255, 0], [255, 50, 50]], [0.9, [255, 50, 50], [255, 50, 50]]] -```js - sequencer.loadImage('PATH') - .addSteps('tint',options) - .run() -``` -where `options` is an object with the following property: -* color : RGB values seperated by a space (default "0 0 255") -* factor : amount of tint (default 0.5) +* "fastie" : [[0, [255, 255, 255], [0, 0, 0]], [0.167, [0, 0, 0], [255, 255, 255]], [0.33, [255, 255, 255], [0, 0, 0]], [0.5, [0, 0, 0], [140, 140, 255]], [0.55, [140, 140, 255], [0, 255, 0]], [0.63, [0, 255, 0], [255, 255, 0]], [0.75, [255, 255, 0], [255, 0, 0]], [0.95, [255, 0, 0], [255, 0, 255]]] +* A custom array. -## Color Temperature -This changes the color temperature of the image. +## Text Overlay -## Usage +The modules allows to add text to image in both browser and node environment. We have the options to modify the font-size and also support few font-styles. The text color can also be modified. +#### Usage ```js sequencer.loadImage('PATH') - .addSteps('color-temperature',options) + .addSteps('grid-overlay',options) .run() ``` -where `options` is an object with the following property: -* temperature : temperature between 0 - 40,000 kelvin (default 6000) +The options can take various attributes like, +var options = { text : 'Hello World', size : '12'}; -## Grid Overlay -This adds the grid over an image. +## Threshold -## Usage +Thresholding is used to create binary images. +#### Usage ```js sequencer.loadImage('PATH') - .addSteps('grid-overlay',options) + .addSteps('threshold',options) .run() ``` where `options` is an object with the following property: -* options.x : The value at which the grid line should start in x-axis. -* options.y : The value at which the grid line should start in y-axis. -* color : Color for the grid on the image. - -# Minify Image - -This module minifies the image using lossy compression that is the image-dimensions are not lost but the size is reduced. - -The module supports jpg/jpeg/webp images in browser; but the node version supports all of the types. - -## Usage +* threshold : it allows to select the types of thresholding (default "manual thresholding") +* input : it allows to select the range of thresholding value (default 120) -```js -sequencer.loadImage('PATH') - .addSteps('minify-image') - .run() -``` -# Text Overlay -The modules allows to add text to image in both browser and node environment. We have the options to modify the font-size and also support few font-styles. The text color can also be modified. +## Tint -## Usage +It adds color tint to an image +#### Usage ```js sequencer.loadImage('PATH') - .addSteps('grid-overlay',options) + .addSteps('tint',options) .run() ``` -The options can take various attributes like, -``` -var options = { text : 'Hello World', size : '12'}; \ No newline at end of file +where `options` is an object with the following property: +* color : RGB values seperated by a space (default "0 0 255") +* factor : amount of tint (default 0.5)