3.2. Video Image Analysis (Dynamic Analysis)
3.2.1. Line Data and Arial Data Extraction
Colorimetric information on any subset (scattered points, points in line(s), or points in a selected area) of still images can be extracted and processed and/or rearranged in ways to express information more effectively. Each point in an image is referred to as a pixel. To demonstrate characteristics of the diffusion speed of test solutions on litmus test strips and pH variations with time, video images were recorded and analyzed. A drop of test solution was placed at the edge of a test paper strip, and liquid diffusion and color change were recorded as a video file (
Video S2).
Figure 7 shows a still image extracted from a video image file 10 s after liquid crossed the left blue tick on the ruler. From the image, we can estimate average diffusion speed of 1.1 mm/s (diffused distance of 11 mm in 10 s) assuming constant diffusion speed. If we can analyze the video images, no assumption is required for diffusion speed characterization.
If we extract colorimetric information along the line perpendicular to the diffusion or reaction front, we will get an exact location of the diffusion boundary and any color variation along the colorimetric sampling line as shown in
Figure 7. If we were taking statistics of sampling aerial data, it can provide average, minimum, maximum, range, mode, standard deviation, and more statistical information of colorimetric data on the sampled area.
3.2.2. Line Data Extraction and Image Reconstruction along a Time Axis
Figure 8a shows five still images at 0, 5, 10, 15, and 20 s after the liquid crossed the left blue tick (distance reference: 0 mm). As seen from the figure, the liquid diffusion speed slows down with time. This may be due to the depletion of liquid source and increase in diffusion resistance with diffusion length increase. If we extract color information along the red line (or any line) along the direction of diffusion on the litmus paper from every frame of a video image and reconstruct a time series of images, diffusion dynamics can be visualized as a time cross-section image. No assumption is required for analysis. We recorded video images for 26 s (from −4 s to 22 s) at 30 fps (frames per second). The total of 720 frames of still images (30 fps × 26 s = 720 frames) were recorded in a video file (
Video S2).
Figure 8b is the reconstructed image from 720 frames. Only one line per frame at the same location (horizontal red line in
Figure 7) was extracted and reconstructed as a time series (time cross-sectional) image. As seen from the image, liquid diffusion speed slows with time and showed parabolic or quadratic behaviors. It also shows that the color of the diffusion front is darker, implying a chemical reaction is in progress.
The diffusion speed of test solutions (A, B, and C) and color change in litmus test paper strips were visualized as time series images by analyzing video files, as shown in
Figure 9. It represents the change in color in a selected line on the litmus paper with time. It visualizes the chemical reaction and diffusion on the sampling line on the litmus test strip over time after dropping a drop of test solution C at the edge of the test strip. The colorimetric data in
Figure 8 and
Figure 9 can be translated into pH values at any point and time. The color image is not only different in appearance but also a rich source of valuable chemical information of test solutions at any point and time. We can even transform the 2D image into a 3D surface plot with distance (x), time (y), and pH (z) axes for more intuitive graphical expression.
Figure 10 is the reprocessed image of
Figure 9. The location of reaction/diffusion front for every frame was highlighted. It is a simplified image and only carries significantly reduced information (reaction/diffusion front as a function of time with no pH information). It resembles an old-fashioned X–t chart recorder image and an X–Y graph (X axis: distance of diffusion and Y axis: time after test solution drop). We certainly feel much more comfortable with this type of simplified graph, because we were trained that way for a long time. However, there is no reason why we have to intentionally reduce information from the original, information-rich image data. We may need to accept a paradigm shift and find a new way of dealing with information-rich image data without intentional filtering for simplification.
Judging from
Figure 10, it is clear that the test solution A (cider) is the fastest diffusing solution through the test strip. The slowest diffusing solution is found to be the test solution C (apple vinegar). The test solution A (cider) and B (refreshment drink) have lower pH values (2.2 to 4.2: strongly acidic) compared to the test solution C (apple vinegar, 5.0–5.9: mild acidity, close to black coffee).
Since these particular video files were recorded at 30 fps, 33.3 ms (1 s/30 fps = 1/30 s) time sensitivity is achieved. High speed (high frame rate) video recording would make more time-sensitive characterization available for fast reaction, fast color change, and/or fast movement. Uniformity or non-uniformity of reaction behaviors can also be quantified through image analysis. Video recording and video file analysis can be very useful for the visualization of time-dependent chemical reactions, such as ink diffusion in water, chromatography, discoloration, etc.
The pH of aqueous solutions can also be electrically measured with a glass electrode and a pH meter. The electrode, or electric pH meter, provide either analog or digital output. It provides one pH value per electrode or meter. The output value is often used for visualization of measurement data in table or graphical form, depending on the applications. In colorimetric characterization techniques, a solid-state (CMOS: complementary metal-semiconductor-oxide or CCD: charge coupled device) image sensor(s) with arrays of pixels are used. Each pixel can carry intensity information on RGB channels and have colorimetric information. Each can be considered as a position-sensitive probe. A still image can be viewed as a two-dimensional (2D) array of colorimetric probes. For video images, three-dimensional (3D: X, Y, and time) sources of information, a video graphic array (VGA) (640 pixel × 480 pixel) image can be viewed as a set of 307,200 pixels (or colorimetric sensors). It can be viewed as a fully integrated, high-density colorimetric sensor array ready for use. Much higher resolution image and video file formats are available. Digital cameras and smartphones with 10 Mega pixel image sensors are not considered high-end anymore. Smartphones with even higher resolution image sensors, up to 16 MP (4920 pixel × 3624 pixel), are readily available. It is more than 50 times better resolution compared to the image sensor for VGA resolution. It is time for turning image sensors into very economic and valuable position- and time-sensitive quantitative colorimetric information generation devices. It does require a paradigm shift. It may be uncomfortable in the beginning, but the benefit will be much greater if we can adapt.
3.3. A Case Study of Video Image Analysis: Lighting Effect on Apperance
As briefly described above, video image is a group of snapshot photos in consecutive time sequence with predetermined time spacings (or intervals). When we record video images of a changing object, every frame of video image captures colorimetric information on all pixels in the image sensor and in a sequential order in predetermined intervals (fps: frame per second). Audio information is often recorded together in a synchronized manner. By analyzing video images, we can monitor and quantify the change in color, intensity, shape, and other circumstantial information. Some subtle information such as the mood of a person, facial expressions, etc., cannot easily be identified or classified in an objective manner. However, most apparent features can be quantitatively and objectively characterized for practical applications. Data mining and information extraction from images opens a totally different world for image processing/analysis. It often has to deal with factors of optical illusion and human psychology.
Figure 11 shows a screen capture image of image processing/analysis software (PicMan) under video image analysis of time resolved color change across the selected cross-sections (A–B and C–D) of color chart printed on a glossy white paper (
Video S3). The video image is 81 s long and was recorded at 30 fps under continuously changing lighting conditions using the controlled LED ring light shown in
Figure 2. The video file can be seen from the
supplement file. It consists of 2430 frames of still images (81 s × 30 fps = 2430 frames). The selected cross-sections of A–B and C–D have widths of 220 pixels each. The colorimetric information (RGB values) on the cross-sections A–B and C–D of the 2430 frames of still images were reconstructed in
Figure 12. Two reconstructed images have 220 pixels × 2430 pixels (width × number of frames) each.
Intensity of RGB channels on a point in the glossy white paper under changing lighting conditions was plotted with red (R), green (G) and blue (B) lines on top of the reconstructed image. The average intensity of RGB values at the point was plotted in gray line. The x axis represents time in the reconstructed image. It is the RGB and average intensity plot as a function of time. The left side is the starting point, and the right side is the end point of video image recording. Since the recording frame rate was 30 fps, 30 pixels in the horizontal direction is equivalent to 1 s in time. From the RGB intensity plot for the point on the glossy white paper, color (or hue) and intensity value of illumination from the LED ring light can be traced, analyzed, and reproduced if necessary. Any time-dependent illumination condition can be recorded and analyzed for record keeping and for future usage. Based on the time-dependent colorimetric recording and analysis results, the same illumination condition can be reproduced as needed without relying on unclear and vague human memory and rather subjective personal impressions/feelings. It is obvious that visual inspection for pH reading under certain lighting conditions can easily be misled as seen from the lower part of
Figure 12b. Appearance of the same color chart is strongly influenced by hue value or color temperature of the illumination source. It is important to maintain the same lighting conditions for quantitative characterization of colors.
A video image, a group of time series still images, can be dissected many different ways. A video image can be considered colorimetric information with 3D data structure (i.e., x, y, and t cube).
Figure 13 shows a line cross-section on single image at a time t
0 and a time cross-section of a point on a series of still images. Any subsets of video images such as point(s), line(s), area(s) at any particular frame(s) or entire frames can be a source of colorimetric information. Any pixel on any frame carries RGB intensity information with coordinate (relative position) and time information. Easy access to the colorimetric information on any point(s), line(s), area(s) at any particular time or interval(s) of interest becomes very important for effective and efficient use of information towards applications of interest.
Colorimetric quantification and dynamic analysis of various properties of matter, including chemical properties such as pH value, can be done through image sensor arrays. Wise use of image sensors is necessary, as machine vision will allow advances in many different fields [
12,
13,
14,
15,
16,
17,
18]. The image information can be used as inputs for machine learning, internet of things (IoT), and artificial intelligence (AI). Development of user friendly, flexible, yet powerful, image processing/analysis software is highly desired. As an initial step, PicMan has been developed as a standalone image processing/analysis software platform for a variety of applications including semiconductor, material science, MEMS, chemistry, biological, pharmaceutical, medical, cultural heritage, and emerging applications [
9,
10,
11,
14]. An understanding of physics of image sensors and development of additional functions of image sensors will broaden the field of applications [
19,
20]. Hyperspectral image sensing and remote sensing applications are also actively investigated [
4,
21]. Development of quantitative colorimetric characterization techniques using off-the-shelf image sensors, USB cameras, and smartphones will open up newer applications.
Digital era image sensors can provide quantitative colorimetric information on objects of interest with relative position (address) information and time stamps for every single pixel on the image sensor array. Effective use of image sensors and information extraction from still and/or video images are the key for the successful integration of image processing/analysis-based tools for emerging applications in machine learning, IoT, and AI. It is time for a paradigm shift for turning image sensors into position- and time-sensitive quantitative colorimetric data sources with the aid of advanced and powerful image processing/analysis software.
3.4. Typical Process Flow for Similar Tasks and Benefits of Using PicMan
Other than the PicMan software package developed for these tasks, no easy to use software package is available. All tasks can be done using combinations of software packages, but it is very labor intensive and time consuming. Multiple software packages have to be running simultaneously and frequent switching between software packages is necessary. This makes still and video image analysis for colorimetric and time dependence study very difficult. For automation of image analysis, application specific algorithms have to be developed. The PicMan software package was developed for addressing manual and semi-automatic image processing needs for feasibility studies, research, and development. It can also be used in full automation mode for batch processing and industrial application with minimal customization.
We have used raw data (RGB intensity data) from each pixel for image analysis and synthesis to avoid risk of adopting inappropriate algorithms or artificial manipulation mistakes. We intended to demonstrate concepts of colorimetric quantitative analysis and time dependence analysis using the raw data from still/video image files (
Videos S1, S2 and S3). Potential hardware-related issues such as different cameras/sensors, quality of the hardware, and settings (e.g., resolution, source of light/lighting conditions, etc.) can be optimized after initial tests. In most cases, cameras/sensors can be selected based on specifications (e.g., resolution, sensitivity, auto focusing, auto contrast, auto brightness control, auto exposure, file format, etc.). Light source and lighting can either be selected or designed to be suitable for specific applications. Noise reduction, smoothing, threshold switching, resolution enhancement, color adjustment, and customized functions can be added. Wireless communication for acquisition of images and analysis results through Bluetooth were successfully demonstrated.
Quantitative analysis, records, and communication eliminate uncertainties and potential miscommunication due to qualitative description. Quantitative analysis is objective, while qualitative analysis is subjective. The benefits of verbal, descriptive analysis should not be underestimated. However, it is highly desirable to use quantitative analysis whenever it is possible.