|
|
|
@ -226,7 +226,7 @@ enum MorphTypes{ |
|
|
|
|
enum MorphShapes { |
|
|
|
|
MORPH_RECT = 0, //!< a rectangular structuring element: \f[E_{ij}=1\f]
|
|
|
|
|
MORPH_CROSS = 1, //!< a cross-shaped structuring element:
|
|
|
|
|
//!< \f[E_{ij} = \fork{1}{if i=\texttt{anchor.y} or j=\texttt{anchor.x}}{0}{otherwise}\f]
|
|
|
|
|
//!< \f[E_{ij} = \begin{cases} 1 & \texttt{if } {i=\texttt{anchor.y } {or } {j=\texttt{anchor.x}}} \\0 & \texttt{otherwise} \end{cases}\f]
|
|
|
|
|
MORPH_ELLIPSE = 2 //!< an elliptic structuring element, that is, a filled ellipse inscribed
|
|
|
|
|
//!< into the rectangle Rect(0, 0, esize.width, 0.esize.height)
|
|
|
|
|
}; |
|
|
|
@ -1457,7 +1457,7 @@ The function smooths an image using the kernel: |
|
|
|
|
|
|
|
|
|
where |
|
|
|
|
|
|
|
|
|
\f[\alpha = \fork{\frac{1}{\texttt{ksize.width*ksize.height}}}{when \texttt{normalize=true}}{1}{otherwise}\f] |
|
|
|
|
\f[\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\f] |
|
|
|
|
|
|
|
|
|
Unnormalized box filter is useful for computing various integral characteristics over each pixel |
|
|
|
|
neighborhood, such as covariance matrices of image derivatives (used in dense optical flow |
|
|
|
@ -1531,7 +1531,7 @@ according to the specified border mode. |
|
|
|
|
|
|
|
|
|
The function does actually compute correlation, not the convolution: |
|
|
|
|
|
|
|
|
|
\f[\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f] |
|
|
|
|
\f[\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f] |
|
|
|
|
|
|
|
|
|
That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip |
|
|
|
|
the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - |
|
|
|
|