You need to enable JavaScript to run this app.SlidingWindow - GammaCV
GammaCV Logo



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.

tSrcTensorThe source data to be processed.
windowSizenumber | Array.<number>
stride?number | Array.<number>window stride.
strategy?numberoutput shape strategy.
0(default): [WH * WW, N, 4];
1: [N, WH * WW, 4];
2: [1, WH * WW * N, 4];
2: [WH * WW * N, 1, 4];
WH - window height,
WW - window width,
N - number of possible windows.

TODO: Reviw description (@worldthirteen, @apilguk)
TODO: Review strategy API
// 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);