# How do I avoid the overuse of subscript?

So I'm doing some computer vision, namely a segmentation task with a depth camera and I'm trying to express the way in which pixels are added to specific regions. I'm unsure of the best way to notate this in my report. In general I'm not hugely experienced with maths and I often trip up when it comes to notation and language. So basically lets say I have 2D array of pixel positional vectors $\mathbf{p}_{i,j}$ and hsv colour vectors $\mathbf{c}_{i,j}$. Both $\mathbf{p}$ and $\mathbf{c}$ contain three variables(?) ($x$, $y$, $z$ and $h$, $s$, $v$). When I'm accessing the region assigned to each pixel (i.e. what group of pixels it is a part of) I have written $r_{i,j}$. For each region I track some statistical data, such as the mean, standard deviation, covariance of all the pixels within it, for both position and colour. So if I'm accessing a region's colour or positional population of pixels I write $r_c$ or $r_p$. I'm not sure if this should be bold because they are populations of vectors. Here is where notation gets really tricky. If I want to notate the standard deviation of a region's positional population for the region assigned to pixel $i,j$ I have written $\boldsymbol{\sigma}_{r_{p_{i,j}}}$. I feel like this is a horrific abuse of subscript and there must be a better way to notate this without having to use so much subscript. Firstly, is that notation theoretically okay if I were to use it? Secondly, are there any better / more correct ways to expressing something like this?

Double subscripts do happen, you should not feel bad about them without any additional reason, one common use case is with subsequences. For example, if $a_1, a_2, a_3$ is some sequence and $i_1,i_2,i_3,\ldots$ is a sequence of indices, you can use $b_k = a_{i_k}$ to extract the corresponding subsequence. On the other hand, frequently it is possible to use some other notation to avoid double subscripts.

Remember that any non-standard notation should be explained! This is very important to avoid confusion.

Some tips:

• Instead of using subscripts like $\sigma_p$, you can use parentheses $\sigma(p)$.
• Instead of using compact one-letter symbols like $\sigma_{p}$ or accents $\bar{x}$ you can use more explicit multi-letter names like $\operatorname{SD}(p)$ or $\operatorname{mean}(x)$ or $\operatorname{avg}(x)$. Note that this is not that common in math context (more in computer-science context), but there are $\det$, $\min$, $\sin$, $\lim$, etc. in general use.
• Instead of using subscripts to identify a cell $\mathbf{p}_{i,j}$, you can say things like "let $p$ be a pixel cell within $\mathbf{p}$" and then use $\sigma_p$.
• If, in the bullet above, you need indices of $p$, you can use $\operatorname{row}(p)$ or $p_{\mathrm{col}}$ or in CS context even $p{{.}\mathrm{col}}$ to have neither parentheses nor subscripts. If you don't like this approach, you can say something along the lines of "let $p$ be the $(i,j)$ pixel cell within $\mathbf{p}$" instead.

If you are using $\LaTeX$:

• For multi-letter names use \operatorname{mean}(x) rather than \mathrm.
• If you are going to use some operator frequently, don't forget to define it using either \DeclareMathOperator{mean}{mean} or \newcommand{mean}{\operatorname{mean}}. Some people like to use arguments, but personally I prefer to use \mean(x) instead of \mean{x}.
• With complex formulae it is really helpful to scale the parentheses, i.e., $$f\big(g(x)\big).$$ Although there are ways to make $\LaTeX$ do this automatically, I have never found a method to achieve consistently good quality and always and up doing this manually. To speed things up I use macros like the following:

\newcommand{\prn}[1]{\mathopen{}\left( {#1} \right)\mathclose{}}
\newcommand{\bigprn}[1]{\mathopen{}\big( {#1} \big)\mathclose{}}
\newcommand{\Bigprn}[1]{\mathopen{}\Big( {#1} \Big)\mathclose{}}
\newcommand{\Biggprn}[1]{\mathopen{}\Bigg( {#1} \Bigg)\mathclose{}}


Edit: using the tip of Mariano Suárez-Álvarez you can simplify the definition with mathtools package: \DeclarePairedDelimiterX{\prn}[1]{(}{)}{#1} and \prn*{x} or \prn[\Big]{x}, etc.

I hope this helps $\ddot\smile$

• You can use \bigl and \bigr, and friends. Sep 6, 2016 at 8:08
• And mathtools's NewPairedDelimiter gives you a unified way of getting scalable and fixed height delimiters — that's the best way to do that Sep 6, 2016 at 8:10
• @MarianoSuárez-Álvarez Thanks, one learns every day $\ddot\smile$ Sep 6, 2016 at 9:05