stroke-width-transform

1.0.0

strokeWidthTransform

src/loadSWT.js

Get the bounding boxes over the text from the image using stroke width transform (SWT)

strokeWidthTransform(image: Image, options: object): Array<Roi>
Parameters
image (Image)
options (object)
Name Description
options.scaleInvariant boolean (default true) Enable scale invariant SWT (to scale to different sizes and then combine the results)
options.interval number (default 1) Intervals for the scale invariant option
options.minNeighbors number (default 1) Minimal neighbors to make a detection valid, this is for scale-invariant version.
options.size number (default 3) Size of the sobel operator for Canny Edge.
options.lowThresh number (default 124) Low threshold for Canny Edge.
options.highThresh number (default 204) High threshold for Canny Edge.
options.maxHeight number (default 300) Maximum height for a letter.
options.minHeight number (default 8) Minimum height for a letter.
options.minArea number (default 38) Minimum occupied area for a letter.
options.aspectRatio number (default 8) Maximum aspect ratio for a letter.
options.stdRatio number (default 0.83) The inner-class standard derivation when grouping letters.
options.thicknessRatio number (default 1.5) The allowable thickness variance when grouping letters.
options.heightRatio number (default 1.7) The allowable height variance when grouping letters.
options.intensityThresh number (default 31) The allowable intensity variance when grouping letters.
options.distanceRatio number (default 2.9) The allowable distance variance when grouping letters.
options.intersectRatio number (default 1.3) The allowable intersect variance when grouping letters.
options.elongateRatio number (default 1.9) The allowable elongate variance when grouping letters.
options.letterThresh number (default 3) The allowable letter threshold.
options.breakdown boolean (default true) If breakdown text line into words.
options.breakdownRatio number (default 1) Apply OTSU method and if inter-class variance above the threshold, it will be break down into words.
Returns
Array<Roi>: Array of regions that contains text.