mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Added example to the documentation for the NormTypes enum (L1, L2, INF)
This commit is contained in:
parent
37ce3b8cfe
commit
3e0b1f2845
BIN
modules/core/doc/pics/NormTypes_OneArray_1-2-INF.png
Normal file
BIN
modules/core/doc/pics/NormTypes_OneArray_1-2-INF.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -164,6 +164,24 @@ enum DecompTypes {
|
||||
\f[norm = \forkthree{\frac{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} }{\|\texttt{src2}\|_{L_{\infty}} }}{if \(\texttt{normType} = \texttt{NORM_RELATIVE_INF}\) }
|
||||
{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_1} }{\|\texttt{src2}\|_{L_1}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L1}\) }
|
||||
{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L2}\) }\f]
|
||||
|
||||
As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$.
|
||||
The \f$ L_{1}, L_{2} \f$ and \f$ L_{\infty} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$
|
||||
is calculated as follows
|
||||
\f{align*}
|
||||
\| r(-1) \|_{L_1} &= |-1| + |2| = 3 \\
|
||||
\| r(-1) \|_{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \\
|
||||
\| r(-1) \|_{L_\infty} &= \max(|-1|,|2|) = 2
|
||||
\f}
|
||||
and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is
|
||||
\f{align*}
|
||||
\| r(0.5) \|_{L_1} &= |0.5| + |0.5| = 1 \\
|
||||
\| r(0.5) \|_{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \\
|
||||
\| r(0.5) \|_{L_\infty} &= \max(|0.5|,|0.5|) = 0.5.
|
||||
\f}
|
||||
The following graphic shows all values for the three norm functions \f$\| r(x) \|_{L_1}, \| r(x) \|_{L_2}\f$ and \f$\| r(x) \|_{L_\infty}\f$.
|
||||
It is notable that the \f$ L_{1} \f$ norm forms the upper and the \f$ L_{\infty} \f$ norm forms the lower border for the example function \f$ r(x) \f$.
|
||||
![Graphs for the different norm functions from the above example](pics/NormTypes_OneArray_1-2-INF.png)
|
||||
*/
|
||||
enum NormTypes { NORM_INF = 1,
|
||||
NORM_L1 = 2,
|
||||
|
Loading…
Reference in New Issue
Block a user