Application of Digital Camera and Digital Image Processing Techmique for Molecular Absorption Analysis in the Visible Spectrum

A method of molecular absorption analysis in the visible spectrum has been developed that does not need monochromatic light and measuring the absorbance. Instead, pictures of the test color solution are taken using a digital camera. The digital image data are transferred to a personal computer through a capture card or a cable. Tristimulus values (R, G and B) representing image chromaticity are found. A polynomial regression equation is applied to describe the relation between one of the R, G or B tristimulus values and a concentration of the test solution in order to calculate the unknown concentration. A computer program is specially created to process all necessary operations. Solutions of MnO4, Cr2O7 , Cu, Fe and NH4 with low and high level concentrations are analyzed with good analytical characteristics.


Introduction
Molecular absorption analysis in the visible spectrum appeared for the first time as a method called Visual colorimetry. Today, a commonly used method of Molecular absorption analysis is Spectrophotometry. Visual colorimetry is deferred from Spectrophotometry in the visible spectrum in some aspects: Spectrophotometry is based on passing monochromatic light, with specific wavelengths from the visible specter, through the test solution, and measuring, with a spectrophotometer, absorbance of the solution. Concentration of the test solution is then found comparing test solution absorbance with the absorbance of standard solutions. For Visual colorimetry polychromatic light of the entire visible specter (which is day light) is applied instead of monochromatic light. The solution absorbs light with some specific wavelengths of the visible specter, and as a result this solution is colored in the complementary color of the light that is absorbed by the solution. The color of the solution varies from pale to dark when concentration increases. The color of the solution is not measured but test solution color is compared "by eye" with the colors of standard solutions in order for concentration to be determined. Nessler tubs were usually applied when the comparison was made. For the same purpose a device named colorimeter was applied. An example of such device was Dubosc colorimeter. The comparison made with this colorimeter was again visual. Visual colorimetry, compared with Spectrophotometry, is a quite simple method because polychromatic light is necessary, and therefore there is no need of a device (monochromator) to convert polychromatic light into monochromatic one. Furthermore this method does not require any type of instrument. Visual estimation simplifies analysis but worsens its results [1]. An example of improved version of Visual colorymetry is now offered by Chemtech International: test kits having vacuum sealed ampoules with reagents which allow self-filling the ampoules with sample solutions, and handy color comparator for visual comparison [2]. Indicator test papers are now another wide spread application of Visual colorymetry. The indicator paper is usually a paper strip impregnated with reagents interacting chemically with analyte and creating a color compound, when the paper strip is introduced in a liquid sample. The comparison is made using a color scale. The most popular are pH indicator papers but they are indicator papers for the determination of ammonia, aniline, phenol, active chlorine, chromium (VI), nickel, nitrites, arsenic [3,4]. Although in some cases analysis by the Visual colorimetry can be accurate, in general this method gives unsatisfactory results, because of subjectivity of the method, and is now used only for semi-quantitative analysis. Further improvement of colorimetric analysis with indicator test paper was made by Etsuko Hirayama et al. In their work an objective evaluation of the colored test paper was done by measuring the color [5]. Besides indicator test paper, an optical sensor (optod) was also used in this work. Optical sensors developed represent a 130 Application of Digital Camera and Digital Image Processing Techmique for Molecular Absorption Analysis in the Visible Spectrum solid hydrophobic film, membrane or foam of a polymer, in which chromogenic reagents are included [6][7][8][9][10][11][12][13]. Gas sensors were also developed. For analyzing sulfur dioxide, hydrogen cyanide and diphosgene in air, the air was passed through a filter, made of modified cotton fabric, which was previously saturated with a chromogenic reagent, and color spot on the filter was then analyzed [14][15][16]. Colorimetric sensor arrays for identification of toxic gases [17] and volatile organic compounds in gas phase [18] were developed as well. All these analyses of liquid and gas samples with colorimetric sensors are based on measuring colors of the sensors, using digital color measuring devices and computer assistance. Digital color analyzer, color digital photographic camera or color flatbed scanner were applied as a measuring device. For above -mentioned analyses with optical sensors, actually reflected light was measured. Not light reflected from the sensor but light transmitted through a color solution is measured, in the present work. That allows all available examples of Molecular absorption analysis in the visible spectrum to be performed, measuring solution color instead absorbance of the solution. The method so developed will possess advantages of both: simplicity of Visual colorimetry and objectivity of the measurement. This method could become an alternative method to the Spectrophotometry.
Digital camera used for color measurements in the work, implements RGB color system. The RGB color system is formed by three main colors: red (R), green (G), and blue (B), which, added together, create the light of the color being measured. Amounts of these three kinds of light are expressed by their numerical values, named tristimulus values or coordinates [19].

Materials and Methods
Reagents, procedures of preparing colored solutions for all examples of analysis done in the work, are the same as for those of the standard Spectrophotometric analysis.
An amateur digital camera Panasonic DMC-LS5 is used for capturing an image of the colored solutions.
Pictures of sample and standard solutions are taken consecutively with a digital camera. The captured solution images are transferred to a personal computer through a capture card or a cable. A region on the image of the colored sample is selected. Color coordinates of the selected region are found. An algorithm that relates color coordinates to concentration is created. Finally the sample concentration is calculated.
Software, specially developed by us for the purpose, performs operations as follows: selecting in two ways a region on the color image; finding in three ways tristimulus values of the selected region; testing different order polynomial regressions or linear regression analysis to describe relation of tristimulus values to standard solution concentration; and finally calculating sample concentration.

Results and Discussions
The method presented here applies CIE RGB color system. Each color for this system is presented by its tristimulus values: R, G and B, and they have to be first found. The picture of test solution represents a color spot on some background. The background has to be separated (this being done by software) and tristimulus values of the remaining color spot to be found. Another approach for the same task is to select a region (for example a rectangular one) on the color spot with a click of the mouse, and then to find tristimulus values of the region selected. Although the selected region on the image of the test solution usually seams homogeneous, it actually consists of a variety of colors. Figure1 shows a statistical distribution of tristimulus values of a yellow-colored complex of ferric sulphosalicylic acid, used for determining iron (III). Each of the three coordinates has "bell-shaped" or normal statistical distribution. In principle the tristimulus values of a given image have to be the dominant R, G and B values that correspond to the dominant color of the image. For normal distribution of the thristimulus values, when increasing and decreasing parts of the distribution curve are symmetric, the most frequently appeared R, G and B values coincide with the mean value of all R values, mean value of all G values and mean value of all B values. In Fig.1 the distribution curves are only slightly asymmetrical. Because of this the tristimulus values found experimentally by the dominant R, G and B values and tristimulus values found by averaging in R, G and B color channel, differ from each other by no more than two or three tristimulus value units. Two ways of determining the dominant three tristimulus values are applied in the work: by the most frequently appeared simultaneously three tristimulus values and by the most repeated thristimulus value in each of the three color channels. The tristimulus values found by these two manners are almost equivalent but the method of the separate color channels must be chosen. When the color spot is homogeneous, there are no significant differences in tristimulus values, found by the two ways of selecting a color image. When the color spot is not homogeneous, a selection by mouse clicking is preferred because a homogeneous part of the image can be separated. Generally, the selection of an entire color spot has an advantage because more reliable information can be taken from the whole color spot. An influence of the different ways of selecting and finding image coordinates upon the final results of analysis is tested by means of R-square coefficient. R-square coefficient shows how points are situated around a curve. From the dispersion of points around the standard calibration curve one can get information about the results of the analysis. When the dispersion is diminishing, shown by the R-square value is tending to one, the results of the analysis become more favorable. From the data for R-square values given in Table 1, one can conclude that determining the tristimulus values by averaging and by finding the most repeated value in every color channel give almost equal results, while the method of repeating the three tristimulus values simultaneously does not give so accurate results. When distribution curve is asymmetric or has more than one maximum, averaging method gives better results. For the method of selecting the whole color spot the results are less successful than those of the method of a selection by mouse clicking because of an indistinct border between the color spot and background. When the concentration of the colored solution is changed, the color of the solution and respectively its tristimulus values are also changed. Figure 2  For analysis of Fe (III), the following results were achieved: for 1.0 μg/cm 3 Fe (III) introduced, we found 1.25 μg/cm 3 Fe (III), SD= 0.22 μg/cm 3 by the three tristimulus values, and respectively 0.996 μg/cm 3 Fe (III) and SD= 0.017 μg/cm 3 by B tristimulus value. Five numbers of determinations were done for each case of analysis. The curve representing dependence of B tristimulus value on concentration, in Fig. 3, has a horizontal part (section III). This part of the curve cannot be used for analytical purposes. The remaining part of the curve forms an interval of concentrations that can be determined by the method proposed here. This part of the curve at low concentrations has a section with a small slope (section I), followed by a section with a steep slope at higher concentrations (section II).
The analytical characteristics, such as sensitivity of analysis, accuracy and probability are better for the steep slope section of the essential part of the curve. In present work the essential part of the curve is treated with different order polynomial regressions. The order of the polynomial regression depends on a position of the standard calibration curve on the useful part of the curve B in Fig. 3.  * t is Students t-value at 95% probability, s is standard deviation, n is number of determinations, n = 5.
Both curves on Fig. 4 are obtained by images of the same standard solutions. The information in Curve 2 is found from pictures taken of the standard solutions which are illuminated more intensively, while for curve 1 the illumination of the solutions is less intensive. The slope of curve 1 is bigger than that of curve 2. In order to find the sensitivity of the method, experimental points of the useful part of the curve are connected with straight lines to achieve a broken line as it is done in Fig.4. The slope of each part of the broken line is determined and then a mean value of all slope values is calculated. The mean, calculated in this way, is the sensitivity. The slope of a straight line, passing through the first and the last point of the useful part of the curve, gives the same result for the absolute value of sensitivity. Sensitivity values for curve 1 and curve 2 are respectively 39.4 and 30.9 tristimulus value units per 1 μg/cm 3 concentration. Detection limit, determined by the three -time standard deviation method, for curve 1 and curve 2 is respectively 0.2 and 0.55 μg/cm 3 . The interval of concentration for curve 1 is from 0.2 to about 4.0 μg/cm 3 , and from 0.55 to about 5.5 μg/cm 3 for curve 2. In conclusion: the intensity of illumination strongly influences base characteristic of the method. An increase in intensity of illumination decreases the sensitivity, worsens the detection limit but allows determining of higher concentrations. Whereas, a diminution in intensity of illumination improves the sensitivities and the detection limit and makes possible the determination of lesser concentrations. Data for analysis of color solutions with low and high level concentrations, corresponding to lower and higher intensity of illumination, are shown in Table 2. Results are acceptable. The investigations confirm that better results are achieved for concentrations corresponding to the section of calibration curve having a larger slope, i. e. an appropriate illumination is to be chosen so that test solution to get into the calibration curve section with a bigger slop.

Conclusion
The developed method is easy to perform and has good analytical characteristics. An important advantage of the method is an ability to analyze both low and high level concentrations by means of changing the intensity of illumination, when pictures of tests solutions are taken. The use of digital camera gives several advantages. Digital camera excels over any other photo detector. It gives a big amount of information. The image consists of millions color points (pixcels). The digital information taken from a color picture is convenient for software processing. Because the digital camera at certain conditions functions as an absolute tristimulus colorimeter [20], it is possible for an absolute analysis to be performed, i. e. an analysis without a calibration curve, but only by previously obtained data for tristimulus values and the corresponding concentrations to them. The kinetic of color reaction can be studied if a digital video camera is used.
The method could be further developed. Arguments for this statement are as follows: There are many other color systems, apart from those used in the process of the work, for which correlation with concentration can be found. A modern digital camera has many opportunities to create a color image. Using these opportunities, a more accurate image can be achieved and in this way the result of the analysis can be improved. This also can be done by precisely arranging the scene and preparing the conditions for taking a picture. A variety of software for processing and editing color images is available which could be used for analytical purposes as well.