Widens a recognizer strip to targetWidth, filling the new columns with the
mean color of the strip's four corner patches so the padding continues the
background instead of introducing a seam some recognizers read as a glyph.
Works on raw bytes rather than tensors because the strip is an intermediate
that the caller writes straight into a pre-allocated canvas tensor with
setData. Images of 1 to 4 channels are supported.
Parameters
strip: Uint8Array
The [height, width, channels] uint8 pixels.
height: number
The strip height.
width: number
The strip width.
channels: number
The channel count.
targetWidth: number
The output width, at least width.
Returns Uint8Array
The [height, targetWidth, channels] pixels.
Throws
With code INVALID_ARGUMENT when strip does
not hold height * width * channels bytes or targetWidth < width.
Widens a recognizer strip to
targetWidth, filling the new columns with the mean color of the strip's four corner patches so the padding continues the background instead of introducing a seam some recognizers read as a glyph.Works on raw bytes rather than tensors because the strip is an intermediate that the caller writes straight into a pre-allocated canvas tensor with
setData. Images of 1 to 4 channels are supported.