Alterna · learning material
11.3. What changes without a window twist
If the coefficients are not symmetrical, the direction of application changes the result.
What this material covers
- The orientation of the kernel is important
Content and key concepts
On the previous page, the window moves on the signal.
If the coefficients are not symmetrical, the direction of application changes the result.
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; расчёт и теория доступны далее.
The orientation of the kernel is important
In a moving physical window, cross-correllation uses a core without a coup:
r
[
i
]
=
∑
j
=
0
K
−
1
h
[
j
]
x
[
i
s
−
p
+
j
]
.
r[i]=\sum_{j=0}^{K-1}h[j]x[is-p+j].
r
[
i
]
=
j
=
0
∑
K
−
1
h
[
j
]
x
[
i
s
−
p
+
j
]
.
For x=[1.2.3.4],h=[1, -1],p0,s1 result[-1 -1 - 1]. The same valid-Window conversion with inverted kernel gives[1,1.1]. The difference between the sign is the result of the order of weights, not the name of the function. For complex signals the correlation usually includes the interface; only the physical numbers are used.
CNN libraries have traditionally called "convolution" the "cross-correllation". For a learning core, this does not limit the family of functions: a coup can be included in the parameters.
the same numbers already asked
It usually changes the answer. H05 directly shares these cases.
Research.
Select kernel[25,5,25], then [1 - 1]. In the first case, both operations coincide because of symmetry; in the second, no. Explain why verification only with symmetrical blur would not detect an error of execution.
Cross-correllation as an abnormal sum of works depends on the size of the signal and the template. It is not automatically equal to the correlation coefficient of Pearson or cosine similarity. Regulation requires additional definitions.
x,h=[1,2,3,4],[1,-1]
corr=[sum(x[i+j]*h[j] for j in range(2)) for i in range(3)]
conv=[sum(x[i+j]*h[1-j] for j in range(2)) for i in range(3)]
assert corr==[-1,-1,-1] and conv==[1,1,1]
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 is a common convention. The family of lirned kernels retains expression, but fixed numbers are important.
How does this question go about the result?
Python examples of Chapter 11
Academic base