High dynamic range in videodensitometry—a comparative study to classic videoscanning on Gentiana extracts

The advantages of high dynamic range (HDR) imaging in videodensitometry are presented and discussed on the example of Gentiana extract thin-layer fingerprints visualized under 254 nm. An inexpensive microscope camera, together with security surveillance lens, mounted instead of original camera on videodensitometry chamber, allows to grab HDR images with high tonal range using Python scripts and OpenCL library. HDR imaging preserves linearity in whole tonal range and does not destroy details in the brightest and darkest plate regions, so it can be seen as a good alternative to classical videodensitometry. Moreover, the tonemapping of HDR images can be used to present a plate photograph with enhanced visibility of weak spots and other details. Principal component analysis done on nine classic exposures and HDR image proves that HDR image contains the highest amount of extracted information from the thin-layer chromatographic plate.


Introduction
Videodensitometric approaches in thin-layer chromatography (TLC) can be traced back to the 1980s [1], but the real practical possibility of computer image processing appeared in the 1990s. A typical equipment consisted then of analog CCD (charge-coupled device) camera and a special PCI (peripheral component interconnect) card, which allowed framegrabbing [2,3]. Papers describing videodensitometry in these years did not dig deeply into the theory or further development of the method. These ideas appeared later, when the image acquisition and processing possibilities increased substantially in a short period of time due to the progress in computer hardware development and the switch to digital photography. Chromatographers became interested in the development of algorithms for background removal [4], quantitative processing [5], to combine them into complete workflows [6,7], optimization of experimental conditions [8][9][10][11], combine them with bioautography [12], or to separate overlapping spots in multivariate way [13]. As an alternative to camera approach, a classical flatbed scanner was also successfully introduced [14][15][16], even with inkjet printer used as an applicator [17]. A smartphone with dedicated software was also proposed numerous times as a videoscanning equipment [18][19][20][21][22][23], making the whole analysis available to many researchers without the need of buying a special hardware.
The current possibilities of open-source software allow processing of TLC images with advanced chemometric algorithms as well as the development of a new code [7]. The idea of open source is excellent, because the software is available without any cost, with the possibility to adjust for a particular need the source code by researchers knowing the basics of programming. The most often used open-source software is ImageJ, written in Java [24,25].
In contrast to classical densitometry, there is no possibility to choose any wavelength during videoscanning. A color digital camera records each pixel as three intensities abbreviated as RGB: red, green, and blue visible light, respectively. Image acquisition under 254 nm, 366 nm, and visible light illumination gives nine channels of information, where fluorescence of the analyzed compounds as well as its quenching on fluorescent plate is a main phenomenon responsible for the obtained information [26,27]. Such multichannel datasets are fantastic targets of advanced pattern recognition algorithms [28,29].
The standard depth of a digital image is 8 bit, which means that each pixel is stored as three integer numbers of range 0-255 for each RGB channel (16,777,216 possible colors). This is the case for 'bitmap' (BMP), Joint Photographic Experts Group (JPG), and 'portable network graphics' (PNG) image formats, commonly used in videoscanning and classical digital photography. However, the tonal range for such images is limited and there is no possibility to make one shot of a scene with very bright and very dark areas, preserving details in both regions. A photographer must decide whether it is required to have bright details with totally black shadows or expose dark details with totally white (overexposed) lights.
This problem led to the development of 'high dynamic range' (HDR) photography where several shots of one scene are taken with increasing exposures [30]. This allows to combine them to one image with increased tonal range for further processing and save in one file (formats such as 'tagged image file format' [TIFF], 'extended range' [EXR], HDR are able to store high-density data) [31]. HDR images can be viewed correctly only on special devices, a typical computer monitor can display them only with much decreased contrast or the user must manipulate the exposure to see details in bright or dark areas. There are numerous algorithms to convert them to normal image (called in this context 'low dynamic range'-LDR) in adaptive way, by varying exposure in different areas, which is called tonemapping [32].
To the best of our knowledge, the HDR approach in videodensitometry is not present in literature. Our practice shows that uneven illumination or vignetting during thinlayer photographing of a plate can visibly change the optimal exposure for various regions of the plate, often resulting in some compromise. Therefore, we have decided to test how HDR can change videoscanning and what can be achieved in this area with an inexpensive equipment.

Experimental
An inexpensive no-name 5-megapixel microscope camera with USB 2.0 interface (producer unknown, sold online by many sellers) was mounted on the top of Desaga (Wiesloch, Germany) CabUVIS videoscanning chamber. D-Max DW-27125DIR lens, dedicated originally for monitoring surveillance cameras, were used instead of a microscope adapter. Original 254-nm fluorescent lamps were used for plate illumination.
Nine exposures in 1-EV (exposure value) steps were taken in a classical way (LDR) and converted to one HDR image with 1280×720 pixel resolution. In-house script written in Python was used to grab the images with algorithms available in OpenCV library. Each exposure was stored as JPG for the reference purposes. HDR images were saved as TIFF, EXR, and raw data (RAW) format. The RAW format was the easiest to transfer data to GNU R environment under R Studio by use of built-in readBin() function on 4-bit floating point stream, whereas LDR images were imported with "jpeg" package. This resulted in 1280×720×3 tensor for each image. Further analysis was done inside R using built-in prcomp() function.
The study was done on a plate with Gentiana extracts from our previous experiments [33]. To summarize shortly, various species were grown in vitro and the culture extracts were chromatographed. The photo presents extracts from seedlings separated to roots (K) and shoots (P), chromatographed pairwise (shoot 1, root 1, shoot 2, root 2, etc., where the numbers 1-9 correspond to a species given in Table 1 of the previous paper). Extraction was carried out in an ultrasonic bath with acetone and water (3:1:1, V/V), followed by evaporation to dryness and dissolving in 5 mL of methanol. Silica gel F 254 plates were used in this study, developed horizontally in sandwich mode with ethyl acetate-methanol-water (8:2:2, V/V) as the mobile phase.

Results and discussion
Theoretically, any webcam-type camera has sufficient resolution to grab photos with various sensitivities, having also high focal depth (so eliminating any problems with focusing). However, the majority of webcams have no possibility to turn off automatic exposure and set it manually to any requested value.
We have tested around a dozen of various webcams available in our faculty or homes without any success. The information about manual exposure control is not given by a webcam manufacturer as such control is not needed for the default webcam purpose, so there is no possibility to purchase a webcam being sure it has the manual exposure control. We ended up with the microscope camera, which has a wide range of manual exposure control (as microscope light can be with a wide range of intensity), but the further task was to find a lens.
The microscope cameras are equipped with C-mount interface, commonly used in 16-mm movie cameras and 'closed circuit television' (CCTV) security cameras. The lenses dedicated for security purposes are a very good choice, because they are inexpensive and have enormous range of angle (focal length) and focusing distance. The aperture is changed in these lenses by applying 'direct 1 3 current' (DC) voltage to a dedicated socket, without it the lens remains completely closed (dark). Therefore, we decided to remove the iris from the lens completely. This gave us high sensitivity of the camera, but the disadvantage was a small focal depth, so the focus had to be set very carefully.
The developed plate with Gentiana extracts was photographed under 254 nm, as this wavelength gives the videoscan with the highest tonal range. We checked photos under 366 nm, but they were relatively darker and not representative to show all phenomena occurring in HDR imaging. It should be also clarified that extensive comparative study of Gentiana samples was done in the previous work [33], so this paper does not present these results in phytochemical context-it would bring the same conclusions. Our purpose is to study the difference between normal and HDR imaging.
Original images of resolution 1280×720 were converted to grayscale (as no colors other than green were present) and cropped not to contain the dark background, resulting in the final dimensions 960×570. Figure 1 presents all 9 LDR exposures (the whole camera range in 1-EV steps), from the darkest (A) to the brightest (I). They are presented in original look (A) and autoscaled grayscale version (B), corrected to have the same brightness and differ only in linearity and recorded details. One can see that expositions A-C are too dark to preserve linearity in any region-the whole plate is presented inside them as a nonlinear quantized image. Expositions D-G seem to look optimal, but they differ in linearity and in detail enhancement in dark and bright areas. Expositions H and I are too bright-no detail is preserved in bright areas; however, the darkest places of plate are better photographed than in A-G exposures. Figure 2 presents the HDR version of this image, compiled from all these LDR expositions. Due to the impossibility to present the full range on standard 8-bit picture, the popular Mantiuk'08 tonemapping algorithm with contrast factor 0.1 and detail factor 5 was applied to this image [32]. It can be easily seen how many details are stored in HDR version and how high is the information content of the combined dataset, comparing to any LDR image. Of course chemometric processing should be done on HDR data with tonemapping, because tonemapping process is lossy and should be used only to present HDR photo as JPG file. To further explore the differences between various LDR exposures and unprocessed HDR image, scaled principal component analysis (PCA) was used on nine LDR images and the HDR image (the matrix had dimensions 10 images×552,900 pixel intensities). Figure 3 presents the PCA scores. As scaled version was used, the absolute brightness is neglected and only relative differences between the same pixels are modeled. 98.2% of variance is placed in the first PC, representing changes from A to I in nonlinear manner. Looking at loading vector of this PC (Fig. 4A), one can conclude that these relative differences are related to linearity in the brightest and darkest places (the brightest pixels are also slightly brighter than black). The second PC, modeling 1.7% of variance, contains details in spots-it can be seen from loading image in Fig. 4B. The low PC2 value represents few details (for example, exposures A, B, H, and I-the brightest and darkest ones). Exposure G contains the largest amount of details, whereas HDR image is a better option and contains much more details and also the largest information in shadows.

Conclusion
Our experiments show that HDR images provide improvements in comparison to classical LDR videodensitometry and they could be recommended for all researchers performing videoscanning. By applying a proper tonemapping, one can produce much better visualization of the plate, including all local details. The second, and most important, is the enhancement of information extracted from plate in all places, regardless of their brightness.