Alterna · learning material
11.5 Two-dimensional image window
A small table moves along rows and columns of the image. One window creates one cell of the sign.
What this material covers
- Filter becomes a small matrix
Content and key concepts
On the previous page, the same frequency data.
A small table moves along rows and columns of the image. One window creates one cell of the sign.
A small window passes through a signal or image. Each exit consists of the numbers of the window and the overall coefficients. The frequency record describes the same data differently.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
Filter becomes a small matrix
Let image X have shape[H,W], kernel K[k_h,k_w]. For correlation without cannels, each exit is the sum of the works in the local rectangle. For strict convolution, the kernel is rotated by
both of them
You can't just turn the lines and think it's done.
Fixture H05: X=[0,1.2],[3,4.5], "[6,7.8]],K=[0.1], [2.3],adding0,stride1. First exit 0×0+1x1+3x2+4×3=19. All output[19,25],][37.43]].
Blur core 3×3 with all weights1/9 averages the window. Identity with the only one center retains internal values. SobelX selects vertical changes, sharpen combines a reinforced center with negative neighbors. The names presets describe the purpose of fixed signals rather than the features already studied by the network.
Experiment.
Change image and kernel to JSON, then padding/stride. Negative and high output values are not cut to the luminance range: the heatmap has a separate display scale, and the numerical table stores the result of the calculation.
For each output axis, the size of the floor((input+2p - kernel)/s)+1 is here on each side, as opposed to the actual-pading recording of some H06 sources. If the window is not placed, an error is shown, not an array of negative lengths. Border zeros can create visible artificial edges.
X=[[0,1,2],[3,4,5],[6,7,8]]; K=[[0,1],[2,3]]
Y=[[sum(X[i+r][j+c]*K[r][c] for r in range(2) for c in range(2))
for j in range(2)] for i in range(2)]
assert Y==[[19,25],[37,43]]
The code repeats the operations just taken care of.
Completely checked Python-example Chapter
Available with a separate file; the short piece shown does not replace its implementation.
This corresponds to replacing both indices of convolution.
Channels and the reuse of coefficients. How does this issue continue?
Python examples of Chapter 11
Academic base