How to get a Standard Deviation weighted average in image? Now I'm trying to implement a SDLWGW algorithm by the Matlab.
currently I'm referencing from
Automatic White Balancing Using Luminance Component and Standard Deviation of RGB Components
the problem is I can't understand  how to get a $SDLWA_{R}$ and the bar of $L_{red}(k)$?
Also what if the $L_{weight}(i,j)$ is $0.9$ then how to calculate the bar of $L_{red}(k)$?
I can't understand it.
I want to know that what is the different between $SD_{red}(k)$ and $SD_{red}(l)$?
$$SDLWA_{R}=\sum_{k=1}^{n}\frac{SD_{red}(k)}{\sum_{l=1}^{n}SD_{red}(l)}\times red_{i,j}(k) $$
What is the $SD_{red}(l)$? Especially, what is the $l$?
$$ \sum_{l=1}^{n}SD_{red}(l) $$
update 1
I have got a question one more,
The paper was written like this
L_weight(i,j) is a positive single-peak function (e.g
triangular function or Gaussian function) value for the
luminance value at i-th row, j-th column of the k-th block.
but I can't understand what is the mean? How can I make L_weight(i,j) ?
Would you please give me any hint please ?
update2.
I'm trying to understand a below answer.
Q1. What if I've got a this block then I think that the k is to
be 12 and p is 5, and q is 5. am I correct?
Q2. How to get a $\overline{L\_red(k)}$ value as below the case?
Q2-1. Especially, I want to know that what does exactly indicate the $L\_weight(1,1)red_{1,1}(k)$ and $L\_weight(1,1)$, as below the case?
I think we know the value of the $red_{1,1}(k)$ But I'm confused that how to know the value of $L\_weight(1,1)$ ?
[![enter image description here][2]][2]
update 3
Does anyone know the relationship between Gaussian weight and one Block ?
The $k$ and $l$ indices are to be understood with indexes under the $\sum$ sign. They can be called "free variables". Suppose that the block $k$ has only two pixels, then $p=1$ and $q=2$. So $\overline{L\_red(k)} $ is just a weighted average (a kind of center of mass) of the $2$ red components from the two pixels  of the block:
$$ \frac{L\_weight(1,1)red_{1,1}(k)+L\_weight(1,2)red_{1,2}(k)}{L\_weight(1,1)+L\_weight(1,2)} $$
which gives you a single value for each block.
Formula (5) has the same interpretation,  you perform the weighted average of those averaged values over blocks, with weights $SD\_red(k)$. 

it is quite easy to use Matlab's block processing tools.