I am working on a program that involves detecting faces in photos, i am reading a paper that someone has wrote and they said that they had more success detecting faces once he they applied some enhancements to the image, one of these being a contrast enhancement. The exact words are...

Contrast enhancement improves the overall quality of the image. Gaussian convolution using the Gaussian function G(x, y) is first applied with the input value channel image in the HSV space. The convolution process can be expressed as follows

They then give you Equation 3: $V_{con} = V_1(x,y) \oplus G(x,y)$ NOTE: $V_1$ is the original value

$V_{CON}$ in Eq. 3 denotes the convolution result, which contains the luminance information from the surrounding pixels. The center pixel value is now compared with the Gaussian convolution result in order to find the amount of contrast enhancement of that center pixel. This process is described by the following equation

Equation 4: $V_{ce}(x,y) = 255V_{le}(x,y)^{E(x,y)}$ NOTE: $V_{le}$ is the result of another enhancement done previously.

where $V_{CE}(x, y)$ is the result of contrast enhancement and $E(x, y)$ is given by the following relation

$E(x,y) = (V_{con}(x,y)/V_1(x,y))^g$

Here g is the image dependent parameter determined by using the standard deviation of the input value channel image. If the center pixel is brighter then the surrounding pixels, the contrast of the pixel is pulled up. On the other hand, if the center pixel is darker then the neighboring pixel then the contrast of the pixel is lowered.

The problem is that with my understanding of maths (NCEA Level 3, Last year at collage) i don't understand how to do the first part, any help would be much appreciated

The full paper is here: http://jips-k.org/dlibrary/JIPS_v09_no1_paper9.pdf


The definition of a convolution product for $\mathbb{R}$-valued functions is the following : $$ f \otimes g : x \mapsto \int_{\mathbb{R}} f(y) g(x-y) dy $$

Since you're dealing with $\mathbb{R}^2$-valued functions, $$ V_1 \otimes G : (x,y) \mapsto \int_{[0,w]\times[0,h]} V_1(x', y') G(x-x', y-y') dx' dy' $$ assuming $V_1$'s support is $[0, w]\times[0,h]$ : your picture's dimensions.

Now, the gaussian function associated to $(m, \sigma) \in \mathbb{R}\times $ (resp. $(M, \Sigma) \in \mathbb{R}^2 \times \mathbb{R}^{2,2} $) is defined as $$ \begin{aligned} & G_{m, \sigma} : x \mapsto \frac{1}{\sqrt{2 \pi \sigma^2}} \exp \left( -\frac{(x-m)^2}{2\sigma^2} \right) \\ & G_{M, \Sigma} :X \mapsto \frac{1}{2 \pi \sqrt{det(\Sigma)}} \exp \left( -\frac{1}{2} {}^t (X-M) \Sigma (X-M) \right) \end{aligned} $$

Though it is not justified in the article and I am no expert in image processing, I believe the point of this operation is to locally smoothe your picture's contrast. These facts may help you understand it $$ \begin{aligned} & f \otimes \delta_a (x) = f(x-a) \\ & \lim_{\sigma \to 0} G_\sigma = \delta_{0} \hspace{3cm}\text{(in the sense of distributions)} \end{aligned} $$ Since you deal with pixels, your convolution product is but a weighted sum of contrast in the vicinity of a given pixel. $M$ should definitely be set to $0$, and $\Sigma$ (which has most likely been set to $1_{\mathbb{R}^2}$ by the authors) defines how "local" the smoothing is.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.