-
Notifications
You must be signed in to change notification settings - Fork 1
5 Color processing tutorial
This part describes the process of transduction and color processing, which involves the areas Retina, LGN, V1, and V4.
The area of Retina is in charge of transforming an RGB image to LMS activations. LMS means the activations of the Low, Medium, and Short frequency cones. In the system, the result is performed by multiplying each vector RGB of the original image by a 3x3 matrix that represents the conversion from RGB->XYZ->LMS. However, the matrix conventions matrices need to be separate for better understanding. The matrix is:
The LMS activations can be viewed in the left part of the visualizer, where the images are in grayscale, because the matrices are of one channel:
In this stage, LMS activations are converted into the DKL color space. Where the activation D,K,L are obtained performing a difference of the activations of the LMS matrices as follows:
- D = L-M
- K = S-(L+M)
- L = L+M
The DKL color space can be represented in a 3D image:
In the implementation, this operation is not a simple summation, a convolution is made in the LMS activation. There are two methods we can choose to perform the operation.
Method 1 is to perform convolutions with normalized gaussian filters (Filter where the sum of all pixels is 1) and then summing using a proportion as follows.
Where
Method 2 is also performing convolutions but with non-normalized filters, and we are in charge of deciding whether to normalize or not the filters, this method is useful for becoming crazy and experimenting with weird values. In this method the operations are these:
Where
The values of the Gaussian functions and the constants
<!--LGN CONFIG-->
<LGNMethod>1</LGNMethod>
<KERNEL_SIZE>3</KERNEL_SIZE>
<UPPER_KERNEL_SIGMA>0.25f</UPPER_KERNEL_SIGMA>
<LOWER_KERNEL_SIGMA>1.25f</LOWER_KERNEL_SIGMA>
<LMM_ALPHA>3.2f</LMM_ALPHA>
<LMM_BETA>3f</LMM_BETA>
<SMLPM_ALPHA>1.2f</SMLPM_ALPHA>
<SMLPM_BETA>1.4f</SMLPM_BETA>
<SMLPM_GAMMA>0.6f</SMLPM_GAMMA>
<SMLPM_DELTA>0.4f</SMLPM_DELTA>
<LPM_ALPHA>0.6f</LPM_ALPHA>
<LPM_BETA>0.4f</LPM_BETA>
The representation of the Gaussians used for the Simple Opponent process can be seen in the next image, where it shows the upper and lower kernel with their respective
The second method consist in edit directly the Kernel filters with the Receptive Field List editor, for that it is needed to change in the configuration file the value of to 2, like this:
<LGNMethod>2</LGNMethod>
Then, we can go to the Receptive Field List tool and choose the folder RFLGN
In the editor, we can modify more parameters. However, the results can be messy because of the freedom of editing the Gaussian filters. It's important to specify the target of each filter; in the image, the target is specified in the columns comb; in this case, the first filter is acting over the L activations and the second on the M activations.
In the case of the S-(L+M) file, the target of the lower filter must be written as LPM.
For editing the filter is better to Open the Gaussian Visualizer, for that we select the upper filter and we can click Copy to visualizer; then we need to activate the checkbox of Gauss 2. In the Receptive Field List, select the row of the lower filter and select the left button copy, and clock paste in the button of the second gaussian.
You can adjust the parameters of the first and second gaussian. For normalizing the two filters, click the button normalize of each filter; the normalization will make that the summation of every pixel of the filter will be 1, and in the case of the difference of gaussian, it will be 0.
If you don to want to normalize the filters, it is also recommended that the summation of the filters will be 0, the effect of increasing the amplitude of the gaussian is an enhancement of the contrast. For that, you can press the button Balance with 0, and the summation of the two filters will be 0.
The activations of the Simple Opponent Cells can be seen on the right side of the activations of the LMS cones of the retina, and also a label indicating wich activation is showing when you enter with the cursor to the image.
2022 Luis Adrian Parra - Niclab