E_{ij}=\fork{1}{if i=\texttt{anchor.y} or j=\texttt{anchor.x}}{0}{otherwise}
\]
\end{itemize}}
\end{itemize}
\cvarg{esize}{Size of the structuring element}
\cvarg{anchor}{The anchor position within the element. The default value $(-1, -1)$ means that the anchor is at the center. Note that only the cross-shaped element's shape depends on the anchor position; in other cases the anchor just regulates by how much the result of the morphological operation is shifted}
The class is the most universal representation of short numerical vectors or tuples. It is possible to convert \texttt{Vec<T,2>} to/from \texttt{Point\_}, \texttt{Vec<T,3>} to/from \texttt{Point3\_}, and \texttt{Vec<T,4>} to \cross{CvScalar}~. The elements of \texttt{Vec} are accessed using \texttt{operator[]}. All the expected vector operations are implemented too:
\begin{itemize}
\item\texttt{v1 = $v2\pm v3$, v1 = v2 * $\alpha$, v1 = $\alpha$ * v2} (plus the corresponding augmenting operations; note that these operations apply \hyperref[saturatecast]{saturate\_cast.3C.3E} to the each computed vector component)
\item$\texttt{v1}=\texttt{v2}\pm\texttt{v3}$, $\texttt{v1}=\texttt{v2}*\alpha$, $\texttt{v1}=\alpha*\texttt{v2}$ (plus the corresponding augmenting operations; note that these operations apply \hyperref[saturatecast]{saturate\_cast.3C.3E} to the each computed vector component)
\item\texttt{v1 == v2, v1 != v2}
\item\texttt{double n = norm(v1); // $L_2$-norm}
\item\texttt{norm(v1)} ($L_2$-norm)
\end{itemize}
For user convenience, the following type aliases are introduced:
...
...
@@ -1517,14 +1517,15 @@ The next important thing to learn about the matrix class is element access. Here
Given these parameters, address of the matrix element $M_{ij}$ is computed as following:
(where \& is used to convert the reference returned by \texttt{at} to a pointer).
if you need to process a whole row of matrix, the most efficient way is to get the pointer to the row first, and then just use plain C operator \texttt{[]}:
...
...
@@ -1576,23 +1577,23 @@ The matrix iterators are random-access iterators, so they can be passed to any S
This is a list of implemented matrix operations that can be combined in arbitrary complex expressions
(here \emph{A}, \emph{B} stand for matrices (\texttt{Mat}), \emph{s} for a scalar (\texttt{Scalar}),
\emph{$\alpha$} for a real-valued scalar (\texttt{double})):
$\alpha$ for a real-valued scalar (\texttt{double})):
\cvCppCross{determinant}, \cvCppCross{repeat} etc.
...
...
@@ -1643,7 +1644,7 @@ Various matrix constructors
These are various constructors that form a matrix. As noticed in the
\hyperref{AutomaticMemoryManagement2}{introduction}, often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression, in which case the old content is dereferenced, or be allocated with \cross{Mat::create}.