我正在尝试在 TeXnic Center 中编写这些方程式,但到目前为止,我还没有成功。我想要编写的方程式如下:http://www.mathworks.com/help/vision/ref/vision.opticalflow-class.html- Horn&Schunk 方法。
The Horn-Schunk method, by assuming that the optical flow is smooth over the entire image, computes an estimate of the velocity field, that minimizes this equation:
\begin{flushleft}
\[
E = \int \!\!\! \int ($I_x$u + $I_y$v + $I_t$)^2 dxdy + \alpha \int \!\!\! \int (\frac{\partial \textit{u}}{\partial x}^2 + \frac{\partial \textit{u}}{\partial y}^2 + \frac{\partial \textit{v}}{\partial x}^2 + \frac{\partial \textit{v}}{\partial y}^2)dxdy
\]
\end{flushleft}
where \alpha is the smoothness term of the velocity field,
\[
\frac{\partial \textit{u}}{\partial x}
\]
and
\[
\frac{\partial \textit{v}}{\partial x}
\]
are the spatial derivatives of the optical velocity component \textit{u}. The \alpha regularization parameter controls the strength of the smoothness constraint and is usually selected heuristically. The Horn-Schunck method minimizes the previous equation to obtain the velocity field, [u v], for each pixel in the image, which is given by the following equations:
\[
\stackrel u{k+1}{x,y} = \stackrel u{-k}{x,y} - \frac{$I_x$[$I_x$\stackrel u{-k}{x,y} + $I_y$\stackrel v{-k}{x,y} + $I_t$]}{\alpha^2 + $I_x$^2 + $I_y$^2
\]
\[
\stackrel v{k+1}{x,y} = \stackrel v{-k}{x,y} - \frac{$I_y$[$I_x$\stackrel u{-k}{x,y} + $I_y$\stackrel v{-k}{x,y} + $I_t$]}{\alpha^2 + $I_x$^2 + $I_y$^2
\]
我是 LateX 新手,编译时没有得到预期结果。此外,当我写入 \alpha 时,文本的格式会有所不同(见附图)。有人能帮帮我吗?
答案1
你已经非常接近目标了,但是你的工作做得有些过了。
首先,在显示的方程式中,您不需要将数学符号括在美元符号内,因此您可以删除$...$
。
其次,您\stackrel
的 是不必要的,而且完全让我感到困惑:下标和上标分别用_
和完成^
。
这是您的代码的清理后的工作版本:
\documentclass{amsart}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
E = \iint (I_xu + I_yv + I_t)^2\,dx\,dy + \alpha \iint
(\frac{\partial u}{\partial x}^2 + \frac{\partial
u}{\partial y}^2 + \frac{\partial v}{\partial x}^2 +
\frac{\partial v}{\partial y}^2)\,dx\,dy
\end{equation*}
where $\alpha$ is the smoothness term of the velocity field,
\[
\frac{\partial u}{\partial x}
\]
and
\[
\frac{\partial v}{\partial x}
\]
are the spatial derivatives of the optical velocity component $u$. The $\alpha$ regularization parameter controls the strength of the smoothness constraint and is usually selected heuristically. The Horn-Schunck method minimizes the previous equation to obtain the velocity field, $[u v]$, for each pixel in the image, which is given by the following equations:
\[
u^{k+1}_{x,y} = u^{-k}_{x,y} - \frac{I_x[I_xu^{-k}_{x,y} + I_yv^{-k}_{x,y} + I_t]}{\alpha^2 + I_x^2 + I_y^2}
\]
\[
v^{k+1}_{x,y} = v^{-k}_{x,y} - \frac{I_y[I_xu^{-k}_{x,y} + I_yv^{-k}_{x,y} + I_t]}{\alpha^2 + I_x^2 + I_y^2}
\]
\end{document}
答案2
我已尝试清理你的代码。
一些应该做的和不该做的事:
不要在显示数学模式中使用 $...$ 来表示数学对象;全部显示数学模式下的对象被视为数学对象。
同样,不要使用
\textit{...}
来表示数学项:如果已经处于数学模式,则无需执行任何额外操作;如果不是,请使用 $u$。(有些字体(但不是全部)会区分数学斜体和文本斜体;在数学模式下,请使用数学(斜体)flushleft
包围显示数学环境的环境没有任何作用;把它关闭。当各种括号括起“大”对象时,要小心调整它们的大小,使用和
\left
,或者\right
更好的是,使用最佳选择的大小调整指令,如\big
和\bigg
。要在变量上写“横线”(上划线)
x
,请写入\bar{x}
或\overline{x}
(如果您想要更粗的横线)。^
使用(“插入符号”)作为上标内容的开始,使用_
(“下划线”)作为下标内容的开始。不要在显然应该是一个逻辑段落的内容中留下多余的空行;全空行会引发段落中断,并且新段落的第一个单词会右缩进(数量为
\parindent
)。当您有方程组(例如示例中的最后两个方程组)时,请尝试使用诸如
align
或 之类的环境align*
。请查阅 amsmath 包的用户指南以了解有关这些环境的更多信息。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
The Horn-Schunk method, by assuming that the optical flow is smooth over the entire image, computes an estimate of the velocity field, that minimizes this equation:
\[
E = \int \!\!\! \int \bigl(I_xu + I_yv + I_t\bigr)^2 dxdy + \alpha \int \!\!\! \int \biggl(\frac{\partial u}{\partial x}^2 + \frac{\partial u}{\partial y}^2 + \frac{\partial v}{\partial x}^2 + \frac{\partial v}{\partial y}^2\biggr)dxdy
\]
where $\alpha$ is the smoothness term of the velocity field and
$\frac{\partial u}{\partial x}$ and
$\frac{\partial v}{\partial x}$
are the spatial derivatives of the optical velocity component~$u$. The $\alpha$ regularization parameter controls the strength of the smoothness constraint and is usually selected heuristically. The Horn-Schunck method minimizes the previous equation to obtain the velocity field, $[u\ v]$, for each pixel in the image, which is given by the following equations:
\begin{align*}
u^{k+1}_{x,y} &= \bar{u}^{k}_{x,y} -
\frac{I_x[I_x \bar{u}^{k}_{x,y} + I_y\bar{v}^{k}_{x,y}
+ I_t]}{\alpha^2 + I_x^2 + I_y^2}\\
v^{k+1}_{x,y} &= \bar{v}^{k}_{x,y} -
\frac{I_y[I_x\bar{u}^{k}_{x,y} + I_y\bar{v}^{k}_{x,y}
+ I_t]}{\alpha^2 + I_x^2 + I_y^2}
\end{align*}
\end{document}
答案3
这里尝试得到一些合理的信息。请注意,您有一个用于二重积分的命令,即\iint
。该amsmath
包(由 加载mathtools
)定义了许多多行方程环境,我使用的是align*
。该nccmath
包在这里是为了让内联公式中的分数为中等大小,而不是文本样式,在我看来,文本样式太小了。
当 Mico 解释命令的含义时\stackrel
,我使用mathabx
包含widebar
命令的包解决了这个问题,在我看来,这比普通的命令更好看\bar
:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools, nccmath, mathabx}%
\begin{document}
The Horn-Schunk method, by assuming that the optical flow is smooth over the entire image, computes an estimate of the velocity field, that minimizes this equation:
\[
E = \iint \bigl(I_x u + I_y v + I_t\bigr)^2 dxdy + \alpha \iint\left(\frac{\partial \textit{u}}{\partial x}^2 + \frac{\partial \textit{u}}{\partial y}^2 + \frac{\partial \textit{v}}{\partial x}^2 + \frac{\partial \textit{v}}{\partial y}^2\right)dxdy,
\]
where $ \alpha $ is the smoothness term of the velocity field, $ \mfrac{\partial \textit{u}}{\partial x} $ and $ \mfrac{\partial \textit{v}}{\partial x} $ are the spatial derivatives of the optical velocity component \textit{u}. The $ \alpha $ regularization parameter controls the strength of the smoothness constraint and is usually selected heuristically. The Horn-Schunck method minimizes the previous equation to obtain the velocity field, $ [u, v] $, for each pixel in the image, which is given by the following equations:
\begin{align*}
\widebar u^ {k+1}_{x,y} & = \widebar u^{k}_{x,y} - \frac{I_x[I_x \widebar u^{k}_{x,y} + I_y \widebar v^{k}_{x,y} + I_t]}{\alpha^2 + I_x^2 + I_y^2} \\
\widebar v^{k+1}_{x,y} & = \widebar v^{k}_{x,y} - \frac{I_y[I_x \widebar u^{k}_{x,y} + I_y \widebar v^{k}_{x,y} + I_t]}{\alpha^2 + I_x^2 + I_y^2}
\end{align*}
\end{document}
答案4
\documentclass{文章} \begin{文档}
[ E = \int \int (\frac{\partial I}{\partial x} {\cdot} u +\frac{ \partial I}{\partial y} \cdot v + \frac{\partial I}{\partial t}) =0 ]
[ E+\int \int (I_u+I_v+I_t)^2 dx dy + \alpha \int \int \frac{\partial u^2}{\partial x} +\frac{\partial u^2}{\partial y}+\frac{\partial u^2}{\partial x} +\frac{\partial v^2}{\partial y} ) dx dy ]
其中 $\alpha $ 是速度场的平滑项,[ \frac{\partial u}{\partial x} ] 和 [ \frac{\partial v}{\partial x} ] 是光速分量 \textit{u} 的空间导数。$\alpha$ 正则化参数控制平滑约束的强度,通常是启发式选择的。Horn-Schunck 方法最小化前面的方程以获得图像中每个像素的速度场 [uv],该速度场由以下方程给出:
\[
\stackrel u{k+1}{x,y} = \stackrel u{-k}{x,y} - \frac{I_x [ I_x \stackrel u{-k}{x,y} + I_y \stackrel v{-k}{x,y} + I_t]}{\alpha^2 + I_x^2 + I_y^2}
\]
\[
\stackrel v{k+1}{x,y} = \stackrel v{-k}{x,y} - \frac{I_y[I_x \stackrel u{-k}{x,y} + I_y \stackrel v{-k}{x,y} + I_t ]}{\alpha^2 + I_x^2 + I_y^2}
\]
\end{document}
我已经编辑了你的文件。请编译并查看输出。