Alternative method of RGB channel spectroscopy using a CCD reader

Ricardo Gobato
Universidade Estadual de Londrina, Brasil
Manuel Simões Filho
Universidade Estadual de Londrina, Brasil

Alternative method of RGB channel spectroscopy using a CCD reader

Ciência e Natura, vol. 39, no. 2, pp. 459-466, 2017

Universidade Federal de Santa Maria

Received: 16 January 2017

Accepted: 14 March 2017

Abstract: Spectroscopy is a technique for collecting physicochemical data through the transmission, absorption or reflection of incident radiant energy in a sample. Our work is used in common low cost and easy access devices that have a CCD reader. Our idea is a set of devices, such as a cell phone, which contains an optical CCD reader, where these equipment materials, materials, compounds, simplifying the image obtained by these optical devices. As filming obtained by optical CCD reader theses hardware, form decoded and separated into their quantified RGB color channels. Our initial technique consists of the analysis of the pixels of the images of primary light sources, such as: the sun, incandescent lamps, fire, candle flames, matchestick flame, wood combustion, etc. We conclude that it is possible to do a spectroscopic analysis using our technique.

Keywords: CCD reader, RGB, Spectroscopy.

1 Introdução

Spectroscopy is a technique for collecting physicochemical data through the transmission, absorption or reflection of incident radiant energy in a sample. It is much employed to be used in their spectra, which is difficult to access equipment because of its high cost, found in research surveys. [1] Our work is used in common low cost and easy access devices that have a CCD reader, which is replaced by these spectrometers. It is possible to determine mathematical parameters that characterize by mapping the images obtained by common cameras such as: cell phones, smartphone, tablet, iphone, ipad, webcam, etc. As filming obtained by optical CCD reader [2, 3, 4] theses hardware, form decoded and separated into their quantified RGB E color channels. Our technique consists of the analysis of the pixels of the images of primary light sources, such as: the sun, incandescent lamps, fire, candle flames [5, 6, 7, 8], matchestick flame, wood combustion, etc. [9, 10]

The Figure (1) represents of a black image of 100x100 pixels, that is, 10000 pixels. As an example a file that has 30054 bytes of size, of which 54 bytes are of file identification as the “family" bmp, corresponds to 30000 bytes, dividing by 3, we have 10000 pixels, if it is of quadrangular dimensions, we will have 100x100 pixels, which correspond to 300x100 bytes. [9, 10]

History

The RGB color model is based on the Young–Helmholtz theory of trichromatic color vision, developed by Thomas Young and Hermann Helmholtz in the early to mid nineteenth century, and on James Clerk Maxwell’s color triangle that elaborated that theory 1860. [11]

One common application of the RGB color model is the display of colors on a cathode ray tube (CRT), liquid crystal display (LCD), plasma display, or organic light emitting diode (OLED) display such as a television, a computer’s monitor, or a large scale screen. Each pixel on the screen is built by driving three small and very close but still separated RGB light sources. At common viewing distance, the separate sources are indistinguishable, which tricks the eye to see a given solid color. All the pixels together arranged in the rectangular screen surface conforms the color image. [11]

Representation of a black
image of 100x100 pixels, ie., 10000 pixels. [9, 10]
Figure 1
Representation of a black image of 100x100 pixels, ie., 10000 pixels. [9, 10]

In color television and video cameras manufactured before the 1990s, the incoming light was separated by prisms and filters into the three RGB primary colors feeding each color into a separate video camera tube (or pickup tube). These tubes are a type of cathode ray tube, not to be confused with that of CRT displays. [11]

With the arrival of commercially viable charge-coupled device (CCD) technology in the 1980s, first the pickup tubes were replaced with this kind of sensor. Later, higher scale integration electronics was applied (mainly by Sony), simplifying and even removing the intermediate optics, thereby reducing the size of home video cameras and eventually leading to the development of full camcorders. Current webcams and mobile phones with cameras are the most miniaturized commercial forms of such technology. [11]

Photographic digital cameras that use a CMOS or CCD image sensor often operate with some variation of the RGB model. In a Bayer filter arrangement, green is given twice as many detectors as red and blue (ratio 1:2:1) in order to achieve higher luminance resolution than chrominance resolution. The sensor has a grid of red, green and blue detectors arranged so that the first row is RGRGRGRG, the next is GBGBGBGB, and that sequence is repeated in subsequent rows. For every channel, missing pixels are obtained by interpolation in the demosaicing process to build up the complete image. Also, other processes used to be applied in order to map the camera RGB measurements into a standard RGB color space as sRGB. [11]

Pixels and the .bmp image

Pixel (the agglutination of Picture and Element). [11] Every three bytes equals one pixel in a bmp file. Therefore each color is defined by a set of three bytes, one pixel. On a color monitor each pixel is composed of a set of 3 bytes (3 colors): red (R), green (G), and blue (B), the RGB standard used here. RGB is the abbreviation for the additive color system consisting of Red (Red), Green (Green) and Blue (Blue). In the best monitors each of these points is capable of displaying 256 different shades (equivalent to 8 bits) and combining shades of three dots (256x256x256) it is then possible to display just over 16.7 million different colors (exactly 16,777,216). At 640 x 480 resolution we have 307,200 pixels, approximately 0.31 megapixel, at 800 x 600 we have 480,000 pixels, at 1024 x 768 we have 786,432 pixels and so on. In a bmp file the image is determined from byte number 54. From byte 0 to 53 is machine identification of the bmp file, such as size, image quality, etc. The image in Figure (1), the sequence of bytes 54, 55, and 56, matches on your screen as the lower left corner. The location of each pixel is from left to right to the end of the screen, sequencing on a line just above, from left to right, and so on, from left to right and from bottom to top respectively. [5, 8, 9, 10]

Table 1.
Decimal and Hexadecimal representation of some colors, in combination of three pixels. [9, 10]
Decimal and Hexadecimal representation of some colors, in combination of three
pixels. [9, 10]

Table (1) shows a sample of the three RGB channels, at their intensities for some colors in decimal e hexadecimal. One can notice an RGB matrix, Aij=A3x3=255.[I]3x3.

2 Materials and Methods

Candle. The candle is commonly found in supermarkets basically presents paraffin in its chemical composition.

Paraffin has been employed for the manufacture of candles since the middle of the 19th century. A mixture of saturated hydrocarbons, it is now obtained almost exclusively from petroleum. The melting point of paraffin varies with the chain lengths of its constituents. Pure paraffins are colorless and transparent, and display a wide range of softening points. Candles made from paraffin occupy a market share today of over 95%, with the remainder being based largely on either stearin (ca. 3%) or beeswax (ca. 2%). [5, 6]

A burning candle seems far removed from the suspenseful world of chemistry, since it would appear to amount to nothing more than combustion of an organic compound:

(1)

Tablet. [12, 13]

Display: Capacitive touch multitouch 7 inch touchscreen LCD, 1024 x 600 pixel resolution, 16: 9 aspect ratio.

Operating system: Android 4.0, English.

Processor: 1GHz.

Storage: 16GB (with possibility to expand up to 32GB with Micro SD Card).

Connectivity: IEEE 802.11b/g/n wireless network and Bluetooth 2.1 + EDR.

Cameras: Front 2.0MP VGA and rear.

Measurements: 196 x 120 x 11.4mm (WxHxD).

Weight: 398g (without the rubberised cap)

Incandescent light bulb and Match. [11]

We present the data of this spectroscopy didactic technique for: flame of a common candle; Combustion of the matches head as soon as it is set on fire; Star sun at 13:00 UTC at given location [14]; and a standard 40W incandescent bulb in dark room.

Only one single image of each event of all images is shown. The best images were separated, which presented minor imperfections of manipulation of a common user. A fact that is the goal of the technique, that an ordinary user takes a single photograph, or make the filming and this device can determine what this image is about.

The decoding of each image was obtained through the program ImageJ, [15] a software available for free access on the internet. In our experiment several events were filmed, and so we developed a software for the decoding of each image, as well as the final result of the quantity of each color of the RGB channels, from 0 to 255.

The images were obtained through a common device, a camera of a tablet of the brand Positivo Ypy. [12, 13] This device outputs a .3gp file. Of these films were separated their due frames with output of image of .jpg and converted to the format of work .bmp., Standard RGB.

The software was developed in Delphi language, [16] where source algorithms for converting .jpg images to .bmp and separation of RGB color channels were also obtained from free access on the internet.

Flame of a candle

For the candle flame the displayed graph represents the normalized average of 242 selected images, of the 256 bytes of each RGB color channel. The film obtained through the camera of a tablet, with 350 frames of a .3gp file, converted to .jpg and .bmp, with dimensions of 640x480 pixels, that is, 307,200 pixels.

Matchstick

For the burning of the matchestick containing potassium chlorate, [11] the graph represents the normalized average, for the 256 bytes, of each RGB color channel, of 57 selected frames, 640x480 pixels, of the 139 images produced.

Sun Light

The image was taken by the same device as the tablet. On Tuesday, August 19, 2014, 13: 00UTC, Latitude: 22o 59 ’48 "S Longitude: 51o 11’ 26" W, altitude of 590 m, under atmospheric pressure conditions of 954hPa, 45% humidity, unlimited visibility, 14C dew point, [14] with 2,000 frames for each color channel.

The graphic was built for each RGB color channel separately, through the normalized average of 2000 frames of 751x556 image files in .bmp format.

Incandescent lamp

For the standard 40W incandescent lamp [11] under similar conditions and using the same tablet. The images were obtained in the same place, under conditions of atmospheric pressure of 950hPa, ambient temperature of 27C, 45% humidity, zero visibility in dark room, 14C dew point, same day, Tuesday, August 19, 2014 , 20:00 UTC, [14] with 2001 frames for each separate RGB color channel.

The graphic was built for each RGB color channel separately, for the normalized average of 2001 frames of 750x1000 in .bmp, after the previous image conversion.

3 Results and Conclusions

The Figures (2,3,4,5) represent a ternary graph in percent for the intensity of each RGB color (Red, Green and Blue) and each has its own characteristic.

Fig. (6) Sample figures used: Candle Flame, Flame Match Sticks, Sun Light and Incandescent Light Bulb. Figures 7,8,9,10 represent a graph for the intensity of each RGB color (Red, Green and Blue), from left to right, respectively. Each graph is normalized to the intensity of each RGB color channel from 0 to 255.

Fig. (7) the candle flame; Fig. (8) Burning the head of the match matches; Fig. (9) sunlight; And Fig. (10) light from an incandescent lamp. These graphics also feature the characteristic trend line of Candle Flame, Flame Match Sticks, Sun Light and Incandescent Light Bulb. Is represented by polynomial equation of order 6, for the intensity each of the RGB colors, from 0 to 255.

By doing a more detailed study one can obtain characteristic mathematical parameters and graphs that can identify things, materials, compounds, in others, using this technique of spectroscopic analysis by separating RGB color channels from .bmp images.

Ternary graphic for the
flame of a candle
Figure 2
Ternary graphic for the flame of a candle

Ternary graphic for the
flame of the initial burning of a matchstick
Figure 3
Ternary graphic for the flame of the initial burning of a matchstick

Ternary
graphic for an image of the light produced by the sun star.
Figure 4
Ternary graphic for an image of the light produced by the sun star.

Ternary
graphic for the incandescent light bulb.
Figure 5
Ternary graphic for the incandescent light bulb.

Samples used
photographics: Candle Flame, Match Sticks Flame, Sun Light and Incandescent
Light Bulb.
Figure 6
Samples used photographics: Candle Flame, Match Sticks Flame, Sun Light and Incandescent Light Bulb.

Representation
of the channel RGB of flame of a candle.
Figure 7
Representation of the channel RGB of flame of a candle.

Representation
of the channel RGB of match sticks flame.
Figure 8
Representation of the channel RGB of match sticks flame.

Representation
of the channel RGB of Sun light.
Figure 9
Representation of the channel RGB of Sun light.

Representation
of the channel RGB of incandescent light bulb.
Figure 10
Representation of the channel RGB of incandescent light bulb.

Referências

[1] R. E. Newnham. Properties of materials. Anisotropy, Simmetry, Structure. Oxford University press, New York, 2005.

[2] T. T. Grove and M. F. Masters. A student assembled spectrograph with ccd detector to assist with student understanding of spectrometry. Physics Department, Indiana University.

[3] C. de Izara and O. Vallee. On the use of linear ccd image sensors in optics experiments. Am. J. Phys., 62:357–361, 1994.

[4] M. Vannoni and G. Molesini. Speckle interferometry experiments with a digital photo camera. Am. J. Phys., 72:906–09, 2004.

[5] K. Roth. Chem. Unserer Zeit.., 37:424–429, 2003.

[6] K. Roth. Chemie in unserer zeit/wiley-vch. Freie Universität Berlin, 2011.

[7] J. Walker. Sci. Amer, (238):154, 1978.

[8] M. Faraday. The Chemical History of a Candle. Dover, Mineola, USA, Dover, Mineola, USA, 2002.

[9] M. Sim oes F. and R. Gobato. Espectroscopia por Mapeamento RGB de Fontes Primárias de Luz. In XIX Semana da Física. Simpósio Comemorativo dos 40 Anos do Curso de Física da Universidade Estadual de Londrina. Universidade Estadual de Londrina, Sep 15-19 2014.

[10] M. Sim oes F. and R. Gobato. Espectroscopia por Mapeamento RGB de Fontes Primárias de Luz. viXra.org. Condensed Matter, page 366, Jan. 06 2017. viXra:1701.0306.

[11] CC BY-NC-SA 3.0. Creative commons. Wikipedia, The Free Encyclopedia, May 2016. CC BY-NC-SA 3.0.

[12] FNDE Fundo Nacional de Desenvolvimento da Educaçao. FNDE, 2012.

[13] R. Ghedin. Estes são os tablets (sim, no plural) da Positivo que o MEC distribuirá aos professores do ensino público, Fev. 01 2013.

[14] P. Repkin and Y. G. Elshin. Yowindow, Jan. 2009-2016.

[15] W. Rasband. ImageJ 1.51i.

[16] Planeta Delphi - Tudo sobre programação Delphi, Jan 12 2017.

HTML generated from XML JATS4R by