A Linear Criterion to sort Color Components in Images

The color and its representation play a basic role in Image Analysis process. Several methods can be beneficial whenever they have a correct representation of wave-length variations used to represent scenes with a camera. A wide variety of spaces and color representations is founded in specialized literature. Each one is useful in concrete circumstances and others may offer redundant color information (for instance, all RGB components are high correlated). This work deals with the task of identifying and sorting which component from several color representations offers the majority of information about the scene. This approach is based on analyzing linear dependences among each color component, by the implementation of a new sorting algorithm based on entropy. The proposal is tested in several outdoor/indoor scenes with different light conditions. Repeatability and stability are tested in order to guarantee its use in several image analysis applications. Finally, the results of this work have been used to enhance an external algorithm to compensate the camera random vibrations.


Introduction
A camera is an array of photo-sensor, which codes certain wave-lengths as intensities.The wave-lengths intensities typically are encoded as color spaces, which are conformed by components.This coding has meaning relating to physical/theoretical foundation of coding.This coding results useful because it is helpful to formulate several criteria to segment and cluster the color space.
Color analysis consists in determining which wavelengths are useful to represent information attending the coding color space.Then, color space is defined as the combination of a basic wavelengths set used to express colors.The nature of wavelengths used as the basis and physical/theoretical constraints define the properties of the space, such as the number of colors that can be represented, or the operations that can be performed.Common color spaces include RGB (Süsstrunk, Buckley & Swen, 1999), CMYK (Gatter, 2005), HSL (Levkowitz & Herman, 1993), to mention a few.The application of each one can be found in several works (Vartak & Mankar, 2013;Ramanath, S., Yoo, & Drew, 2005;Bhattacharayya, 2011, andYang, Liu, &Zhang, 2010).They use color space properties focusing in a particular task, exploiting characteristics that can be used for own purposes.The RGB color space represents a color standard used by several devices.Physically, they use sensors calibrated to respond to red, blue and green wavelengths, and several add an extra color to increase slightly wavelength sensitivity.By determining the quantity of information through entropy measurement, the importance of each orthogonal component used, constituted of several color components, can be detected.
In this work, an approach to identify which component provides more information, based on its contribution, in an orthogonal space constituted by several color components, is proposed.This component offers best information to dynamically select features for camera stabilization algorithm (Jiménez & Salas, 2011).The discrimination process quantifies the contribution of each color component from the main orthogonal components.Finally, the physical color component that represents the most significant projection of orthogonal space of several color components might represent the best physical component.

Space Color Foundations
Basic components used to represent tonalities conforms a basis of a color space.A color space is a notation to specify possible colors.Different bases are mixed as tuples to represent a specific tonality.Each component represents any value of a basic component.A color space S is denoted by a set of basic components C 1 , .... , C n , where n is the number of components and it usually takes 3 or 4 values.Each C i represents a possible value of particular component.Typically, each component is encoded in 0,1 Each component domain is continuous, but physically is implemented to fixed domain-resolution representations.A specific color is represented as a mixture of basic components.Ideally, basic components must be uncorrelated and independent.In practice, the amount of color-mixtures that conforms a scenario makes complicated this constraint.Commonly, color spaces can be classified in three main categorizations (Asmare, Asirvadam, & Iznita, 2009;Ebied, 2012;Palus, 1998 andWei, Zhao, &Zhou, Dec. 2013): (A), which include the RGB color space, based upon the component colors theory and phenomenal color spaces.These color spaces are created based on the HSV properties (Palus, 1998).(B):This categorization includes the color spaces adopted from TV systems (YUV, YIQ), photo systems (Kodak Photo YCC) and printing systems (CMY(K)) (Gatter, 2005),.(C)are spaces proposed by the CIE and have some high importance properties like device-independency and perceptual linearity (CIE XYZ, Lab and Luv) (Palus, 1998).
The above categorization is based on physical foundations of color.However, according to the current technologies some extra spaces or coding color schemes are added (Kekre & Sonawane, 2014).
Finally, according to aforementioned paragraphs, and the aim of this work, it only takes a set of fixed color spaces and coding schemes to represent images.The spaces and coding schemes focused on this work include RGB, HSV, YCbCr and NTSC, mainly (Fairchild, 2013).

Dependence as a Measure of Information
The three following sections provide the foundation for color components as a sorting linear component problem, which represents the main contribution of this work.Given a set of n different information sources expressed as x 1 ,…,x n , the dispersion of raw data can be represented as an orthogonal space.However, this space does not necessarily follows a physical interpretation and it does not need strictly n different components to be represented.This is since there are several redundant information sources.The orthogonal space is represented by u n orthogonal components.At this point, color components are considered as a mixture of principal orthogonal components of this space as follows: , where each a 1 is a weighted constant, related to the contribution of any orthogonal component to a specific information source.In general, the different information sources can be described by an orthogonal space generated as follows: where x i denotes a particular information source, u i an orthogonal component and a i a number vector such that contains the weights that compose each information source.For all individual vector-products, T would benefit those which contain the majority of information.Thus, the problem seems similar to Principal Component Approach PCA, (Lay, 2003 andGood, Kost, &Cherry, 2010).However, note that the aim of our problem consists of determining which physical component x i is the most important, not to do a reduction of orthogonal space with the projection of most important information.It is necessary to define a criterion to sort physical components x i that contain the most suitable information.
Let it be X the matrix compounded by different information sources with m samples.The X matrix can be rewritten as X = UΣV T .Diagonal values of Σ determine the rank of the matrix and the weighted importance of orthogonal components that conform X (Lay, 2003).Assuming that Σ contains the eigen-values sorted from the highest to the lowest, singular value decomposition SVD (Lay, 2003) can be applied to determine a criterion to weight which physical information sources are more relevant.For notation, we denote the i − th eigen-value from Σ as σ i .The amount of information is considered as a normalized contribution of each orthogonal component space u n .This information measure has one inconvenient: it only measures orthogonal components; but it does not say explicitly how to verify the contribution in physical variables.This becomes difficult because each physical variable is composed of at least one or several orthogonal components, as demonstrated by figure 1. Please note that whenever the orthogonal components correspond in an ideal case with any source of information, it is easier to determine which information sources become with higher importance.However, when they are not aligned with the components, as usually happens, the calculation becomes complicated since the orthogonal components are constituted from a mixture of different information physical sources.

Weighting Linear Components
Once we have a way to separate orthogonal components, a weighting process is needed to establish an order relationship.The Σ matrix of eigen-values determines the importance of orthogonal structure constituted by all information sources.Consider at this point that in the rank M ( ) = n´ with n´< n there are certain degrees of redundancy in x 1 ,...,x n information sources.However, it is not possible to separate orthogonal basis of raw data expressed in X; but it is possible to detect its effects and contributions on physical variables.In other words, if an x i component contributes with different information to the system, then the use of x i will affect the rank (X) in the number of independent components in U space.
Adding the x n+1 information source, which is dependent upon previous sources, does not affect the rank (X).When information in x n+1 is independent, we have σ n+1 > 0 , where σ n+1 magnitude tell us the amount of new information in the system.

Sorting Components
Finally, using above weighting criterion an algorithm to sort linear component is proposed as follows.For n information sources it is desirable to add a new one from a candidate list of x 1 , { ...,x k } .Furthermore, it is desirable to add those with distinct information, such as is denoted by the max σ n+1 i { } contribution under construct a matrix X, x i ( ) Then, in inverse order, a selection of those physical components that represents the lowest effect in orthogonal space can be iteratively applied.Also, a set of physical information sources x 1 , { ...,x n } , is represented in an U space with u 1 ,...,u n orthogonal components.If the information sources are linearly redundant, some components are null.By selecting one physical information source x i , it can be possible to quantify the effect in the orthogonal space U and relate with the importance to constitute it.This is, if the information source x 1 does not contribute to the rank of X, it does not change.In case it contributes, the change of last normalized eigen-value from reduced matrix to the original matrix represents the contribution of use (or not) the variable x i in the system.Wrapping up, a measure to quantify the difference of information in a given matrix X against its reduced form X* under discard the i − th physical component, in terms of its eigen-values, is expressed by: which quantify how a particular component x i contributes with the linear system for a given matrix X and reduced matrix X* and σ i and σ i * eigen-values respectively.Observe that this expression represents the difference of current information that is included in the reduced matrix.This is, whenever Q(X,X*) is greater than 0 means that orthogonal space in reduced matrix is better scattered that original matrix X, i.e. discarded color component did not contribute with information to the image.Consequently, values lower than 0 means that X contains more information than reduced matrix means that discarded color component have important information.Then, the process of discarding x i components can be considered as the iterative process of discarding x i components from X such that X* being a matrix without x i that maximizes max Q(X,X*).
The algorithm with a procedure to select and sort a set of information sources according to each datum's contribution to the orthogonal space is shown.This is shown in Figure 2, where each component x i composed of several orthogonal components as a linear combination a i u i i=1 n ∑ is observed.To exclude any information source from orthogonal space a projection is made in the minor space n − 1.Those components with less effect in orthogonal space are discarded.Please note that this approach is appreciated as complement to the PCA approach, in which a set of variables is sorted according their contributions to an orthogonal space.These sorts generate a projection with most important orthogonal components, with the lack of physical significance to our problem.
Algorithm 1. Selection of components with lowest contribution in an orthogonal space.

Component Selection Algorithm
Inputs: A list of n information sources expressed as components.
1. From n information sources, a matrix X is built as follows T represents k measures from information source i − th.
All information sources have the same number of samples.
2. Compute singular value decomposition of X = UΣV T .
3. Build a matrix Ω = X 1 * , { ...,X n−1 * } , with the reduced matrices from X.The reduced matrix is a matrix X i * such that one component x i has been deleted.Consider a.For all X i * matrices, factorize each one X i * into eigen-value and determine which is the minimum physical variable affectation (see eqn ( 2)).
c. Select the i − th physical to be removed and updated 4. Repeat until there are no physical variables left to discard.

Sorting Color Components
The contribution of each component against to the others is measured due to a C* orthogonal space.This space is conformed to all information of each one pixel encoded in the different spaces.Therefore, a particular pixel I (x i ) as vector c i is created with the form or n different spaces.In this way, C* is created for all pixels belonging to the image as follows Matrix C* represents pixel data which are helpful in knowing which c i physical components have more information.

Sorting Color Components and Meaning
Given a matrix C* that represents image evidence encoded in different color spaces, C* is expressed as , where each c i represents a different component constituted from several forms to represent the color information.Assuming that, in an orthogonal space U truly defines different variables, it can be feasible to detect which physical components are the most important.Observe that the most important color component corresponds to the maximum orthogonal space projection.The analysis of eigen-values in C* shows that the information is only distributed in a few orthogonal components.This projection is dependent upon scene conditions and it might vary in different situations.
Algorithm 1 is applied to the matrix C*.Where matrix Ξ denotes the sorted linear components from C*.In this case, we can select m primary components which correspond to those most suitable to be analyzed in sense they contain a projection from orthogonal space that concentrate the most important components.Note that the information in C is desirable to be centered and normalized in range.An example is shown in Figure 3.The channel decomposition in all different spaces is shown in figure 3(c).Several components of color are visually closely similar or maintain the same structure (as is found with all RGB components, V from HSV, Y from NTSC and Y from YCbCr).In the same way, Figure 3 (b) presents a graph of normalized eigen-values, that shows evidence that there is a compact representation with few orthogonal components.

Experimental Process
In this section, the new proposal is tested using images from database.The images are taken from outdoor and indoor scenes.All images are encoded in the following color spaces and schemes: RGB, HSV, YCbCr and NTSC, resulting in twelve color components (but not limited).Next, the experimental process to validate the proposal is constituted of three main stages: The validation process is performed with a set of several images of outdoor/indoor scenes.The algorithm is applied to the tested image database (see Figure 1).Then, a set of Gabor filters is used to detect different frequencies that conform the texture with the aim to visually show that selected component has more texture information rather other discarded (Kumar & Pang, 2002;Pakdel &Tajeripour, 2011 andJing, Yang, Li, &Kang, 2014).Note that for all image used a Gaussian Filter is used to dismiss noise effects.Finally, the algorithm is used to improve the algorithm presented in (Jiménez & Salas, 2011) to stabilize outdoor camera.tested scenes (see Table 1).The main component selected corresponds to the most probable color component under apply the proposal in all images from database.These results, as is appreciated, are useful since they provide a criterion to automatically select which component (from a linear mixture) for a tested scenario is more reliable to be used.As complementary, the proposal described returns all components sorted according to the linear projection in its rank; which represents a sorting linear criterion applied to sort color components.So we need to note that the more representative components are selected according to the amount of information contained.Then, for small contribution components, it is necessary be cautiously since they are affected by noise effects.In these situations previous filtering process may affect the ordering, especially in noise images.With Gabor filters we notice that the best component selected represent the component in which is easier to appreciate borders and texture information, which make suitable the proposal to select a better image representation to extract features (as Harris, or SIFT to mention a few) (see Figure 8).
Finally shaking and vibration of outdoor cameras have been improving because the number of distinctive features is increasing, and consequently, the algorithm for camera stabilization (Jiménez & Salas, 2011).In Figure 5, we can appreciate the number of features detected frame by frame in the most important component detected, the sixth and last one.As is appreciated, the number of features corresponds to the place ordered by the algorithm.Graphically in Figure 6 a sample of features detected are shown.
To conclude, we present RMSE error of fitting a homography transformation as is commented in (Jiménez & Salas, 2011), In Figure 7 is graphically appreciated the place of occupied component match with the error degree in the stabilization algorithm; for better appreciation, y axis is drawn in log scale.Quantitatively, the results of RMSE average error are shown in Table 2 (error is measured in pixels units).Both results confirm that the algorithm to sort color components effectively help to select those components which have more information.

Analysis of results and Discussion
The most representative color component depends upon luminance factors surrounding the scene from which the picture was taken.The dominant component depends greatly upon the physical characteristics of colors in

Conclusion
In this paper, we present a criterion to evaluate the amount of information encoded in an image.This criterion consists in discovering which physical variable contains more information.
The process consists of discovering an orthogonal space, and how it is conformed due to physical variables.This approach provides a good criterion for selecting the component with most significance.In particular, the paper focused on sort the color components of an image represented in several spaces.The computed order relation might vary due to the number of components used, and noise effects in raw data.

Figure 2 .
Figure 2. Raw Data Space and its projection in a minor dimension.

Figure 3 .
Figure 3. (a) Image in color used as sample for different space decompositions.(b) Eigenvalues of C* matrix; the information is located in a few orthogonal components.(c) Space and component decomposition.As is appreciated the information that refers to each color component is different.

Figure 4 .
Figure 4. Samples from the image database of different scenes used to test the proposal: (a) a baby's room; (b) a city; (c) indoor objects; (d) panoramic scenes; (e) a park; (f) a beach; and, (g) forest scenes.

Figure 5 .
Figure 5. Graph of detected features in the first best component, sixth best component and last component.

Figure 6 .
Figure 6.Sample of frame with features detected using (a) first component detected (I of NTS); (b) sixth component detected (G of RGB) and last component (H of HSV).

Figure 7 .
Figure 7. Homography transformation error estimated with different color components.

Figure 8 .
Figure 8.(a) Sample of an indoor image; (b) the main component detected; (c) super imposed Gabor directional filter.

Table 1 .
Results through sorting color component from database.Each column represents the color component.The numerical value represents the most representative place in which is located this component with a probability expressed in the parenthesis for a particular scenario.

Table 2 .
RMSE average error using different color components in stabilizing algorithm,