![如何表示图像处理中使用的逻辑矩阵(掩码)?](https://linux22.com/image/239541/%E5%A6%82%E4%BD%95%E8%A1%A8%E7%A4%BA%E5%9B%BE%E5%83%8F%E5%A4%84%E7%90%86%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%9A%84%E9%80%BB%E8%BE%91%E7%9F%A9%E9%98%B5%EF%BC%88%E6%8E%A9%E7%A0%81%EF%BC%89%EF%BC%9F.png)
更新如下
在我的论文中,我讨论了图像处理掩码,这是一个与某些图像大小相同的矩阵,但其中图像满足某些条件的部分为 1,而其他部分为 0。我想知道用数学方法描述这种矩阵的好方法是什么?
例如,假设我有两幅灰度图像 Z1 和 Z2,以及一个矩阵 M_BothSat,当两幅图像都高于某个饱和度阈值 t_OS 时,该矩阵的值为 1。我该如何描述 M_BothSat,以便
- M_BothSat 是什么很清楚。
- 对于工程硕士论文来说,该符号在数学上足够严谨。
- 我可以在将来定义更多的掩码,而不会引入歧义或与之前的掩码相冲突的定义。
我意识到这更像是一个数学问题而不是 Latex 问题,但我相信这是获得答案的最佳场所。
我在下面提供了一个我正在尝试做的事情的例子,以及我看过的几种不同的选项,它们都以不同的方式表达了同样的事情。红色文字是我对每种方法的想法,黑色是我在论文中建议使用的。有人能告诉我哪种方法最好,或者建议另一种更好的符号形式吗,那就太好了。我的集合符号有点生疏了。谢谢。
\documentclass[12pt, oneside]{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{color}
\usepackage{amsmath}
\newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\textcolor{red}{
\textbf{Option 0}
This option uses a combination of plain english and math equation. It works nicely for here, but I'm going to define a series of logical masks $\mat{M}$, and seems it will be confusing to redefine $m_{i,j}$ repeatedly.
}
The areas \textit{saturated in both} images are given by the set $\mat{M}_{BothSat}$ of logical values $m_{i,j}$ such that
\begin{equation}
m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases},
\end{equation}
\textcolor{red}{
\textbf{Option 1}
This expresses what I'm trying to say: $\mat{M}_{BothSat}$ is a matrix the same size as $\mat{Z}$, with ones where $\mat{Z_1}$ and $\mat{Z_2}$ are both less than some threshold $t_{OS}$. However, to my eye this looks horrible. with the two opening squiggly braces. If the one beginning the cases could be made thinner, so that the one closing the overall set is less ambiguous, that might work. }
\begin{equation}
\mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases}
\right\},
\end{equation}
\textcolor{red}{
\textbf{Option 2}
This tries to say the same thing, but breaking it apart into two equations. Will this option be confusing if I define a series of different masks $\mat{M}$ with equations like this where each one contains a line defining $m_{i,j}$? }
\begin{gather}
\mat{M}_{BothSat} = \left\{ m_{i,j} \right\} \nonumber
\\m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases},
\end{gather}
\end{document}
更新
我发现另一篇帖子关于修改案例环境,我使用这种方法在案例环境中添加了一个右括号,以便可以将其放在集合符号内,从而使集合的右括号在视觉上稍微不那么混乱。有什么反馈吗?以下是一个例子:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\DeclareMathOperator{\rank}{rank}
\makeatletter
\newenvironment{closedcases}{%
\matrix@check\closedcases\env@closedcases
}{%
\endarray\right\}% \right\lrack
}
\def\env@closedcases{%
\let\@ifnextchar\new@ifnextchar
\left\{
\def\arraystretch{1.2}%
\array{@{}l@{\quad}l@{}}%
}
\makeatother
\newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\begin{equation}
\mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{closedcases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{else}
\end{closedcases}
\right\},
\end{equation}
\end{document}
答案1
二值图像可以表示为一组坐标 (x, y)。对于您的情况:
\[ M_\text{BothSat} = \left{ (i,j) \mid z_{i,j,1} > t_{OS}, z_{i,j,1} > t_{OS} \} \]
答案2
我不太清楚你想要什么。如果你想知道如何让其中一个括号突出,这个解决方案对你有用吗:
\newcommand*{\Cases}{\begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\ 0 & \text{if} \quad \text{else}
\end{cases}
}%
\newcommand*{\VPhantom}{\vphantom{\Cases}}%
\newcommand*{\VPhantomHack}{\vphantom{\Cases^{2}}}%
\newcommand*{\BoldLeftBrace}{\pmb{\left\{\VPhantomHack\right.}}%
\newcommand*{\RightBrace}{\left.\VPhantom\right\}}%
%
\begin{equation}
\mat{M}_{BothSat}
= \BoldLeftBrace m_{i,j} | m_{i,j}
= \Cases \RightBrace,
\end{equation}