SlidingWindow
Description
We want to keep our algorythms clear, so to prepare a data for another algorythm we need a kind of getting data in different view. SlidingWindow is a helper in searching objects in an image, putting each window snaphot as a column, this makes easier to apply another algorythms that should wokrs with that data.
Params
tSrc | Tensor | The source data to be processed. |
windowSize | number | Array.<number> | |
stride? | number | Array.<number> | window stride. |
strategy? | number | output shape strategy. ENUM: 0(default): [WH * WW, N, 4]; 1: [N, WH * WW, 4]; 2: [1, WH * WW * N, 4]; 2: [WH * WW * N, 1, 4]; LEGEND: WH - window height, WW - window width, N - number of possible windows. TODO: Reviw description (@worldthirteen, @apilguk) TODO: Review strategy API |
Example
// this operation will output data in next stragtegy:
// |xyzw| |xyzqwe|
// |qwer| -> |yzwwer|
// |asdf| |qweasd|
// |wersdf|
// where each column is a one state of sliding window,
// and each pixel in a row is a one pixel in a sliding window.
gm.slidingWindowOp(inputImage, 2, 1, 0);