I want to add a box (black color) to encapsulate the last two lines of this triple-line-aligned expression.
As you can see, the current solution inspired by this post is not perfect because it misses some topmost components.
Note that the target is a part of the aligned-expression so the general commends like boxed or empheq may not work.
\newcommand{\pstrut}[1]{\vrule height0pt depth0pt width0pt #1 \fboxsep}
\newcommand*\bmarkeq{\stepcounter{markeq}%
\tikz[remember picture]\node(startframe-\themarkeq){\pstrut{height}};%
\kern\fboxsep}
\newcommand*\emarkeq{\kern\fboxsep
\begin{tikzpicture}[remember picture,overlay]
\node (endframe-\themarkeq){\pstrut{depth}};
\draw[,black,opacity=0.8] (startframe-\themarkeq.north)
rectangle (endframe-\themarkeq.south);
\end{tikzpicture}%
}
\begin{align}
\mathrm{L}{c}(\theta)
= &\sum{i=1}^{m} \ln p\left(x_{i}, z_{i} ; \theta\right) \
= \bmarkeq &\sum_{i=1}^{m}\left(z_{i}\left[\ln (\pi)+x_{i} \ln \left(p_{r}\right)+\left(1-x_{i}\right) \ln \left(1-p_{r}\right)\right] \
&+ \left(1-z_{i}\right)\left[\ln (1-\pi)+x_{i} \ln \left(p_{b}\right)+\left(1-x_{i}\right) \ln \left(1-p_{b}\right)\right]\right) \emarkeq
\end{align}

