{'fraction_non_alphanumeric': 0.025307574732516474, 'fraction_numerical': 0.011501165150717883, 'mean_word_length': 5.0607441154138195, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Noise versus Resolution in Optical Chemical Imaging—How Reliable Are Our Measurements?

Optical chemical imaging has established itself as a valuable technique for visualizing analyte distributions in 2D, notably in medical, biological, and environmental applications. In particular for image acquisitions on small scales between few millimeter to the micrometer range, as well as in heterogeneous samples with steep analyte gradients, image resolution is essential. When individual pixels are inspected, however, image noise becomes a metric as relevant as image accuracy and precision, and denoising filters are applied to preserve relevant information. While denoising filters smooth the image noise, they can also lead to a loss of spatial resolution and thus to a loss of relevant information about analyte distributions. To investigate the trade-off between image resolution and noise reduction for information preservation, we studied the impact of random camera noise and noise due to incorrect camera settings on oxygen optodes using the ratiometric imaging technique. First, we estimated the noise amplification across the calibration process using a Monte Carlo simulation for nonlinear fit models. We demonstrated how initially marginal random camera noise results in a significant standard deviation (SD) for oxygen concentration of up to 2.73% air under anoxic conditions, although the measurement was conducted under ideal conditions and over 270 thousand sample pixels were considered during calibration. Second, we studied the effect of the Gaussian denoising filter on a steep oxygen gradient and investigated the impact when the smoothing filter is applied during data processing. Finally, we demonstrated the effectiveness of a Savitzky-Golay filter compared to the well-established Gaussian filter.


INTRODUCTION
Chemical imaging and mapping is the analytical approach to acquire a visual image of an analyte distribution by measuring its spectral, spatial, or temporal information in 2D or even 3D. 1 The general term optical chemical imaging encompasses a variety of methods, including Raman microscopy 2,3 and hyperspectral imaging. 4,5 As a subcategory of optical chemical imaging, luminescence-based chemical imaging employs luminescent dyes, the luminescence properties of which can be correlated with the concentration of a target analyte. 1,6 Those luminescentbased optical chemical sensors are also called optodes. The main detection methods used for such optodes are (i) ratiometric imaging 4,7 and (ii) lifetime-based imaging. 8,9 In ratiometric imaging an analyte-sensitive indicator dye and an analyteinsensitive reference dye are combined in an optode, and the intensity ratio of the indicator relative to the reference dye is determined for ratiometric read-out ( Figure 1). In contrast, lifetime-based imaging correlates the luminescence decay time of the indicator with the analyte concentration. While the latter one is a self-referenced method that is less susceptible to optical interferences than intensity-based imaging techniques, it requires, however, a more complex and sophisticated detection system. In recent years, optical chemical imaging has advanced tremendously, particularly since it became possible to image analyte distributions using simple and affordable color cameras. 6,7,10 Since then, optodes have proven to be valuable tools for various biological, environmental, and medical applications, especially when it comes to the mapping of analyte distributions and dynamics in heterogeneous and complex samples at the microscale 11−19 or across scales. 20−22 With the set goal of visualizing analyte distributions in finer details, image resolution, as well as image accuracy and precision, became crucial parameters to describe the image quality. While microscopic imaging often aims at visualizing structural elements (e.g., organelles or macromolecules within cells), 23 optodes aim to visualize analyte dynamics and interactions on a spatial scale of few micrometers to centimeters with the highest resolution possible, that is, to perceive the smallest possible change in an analyte. 24 However, inherent camera noise can deteriorate the image quality as it obscures relevant information. 25 Even if the initial signal variation that occurs during image acquisition is marginal, this random but not entirely avoidable signal variation can propagate and amplify as measurement uncertainty through the data processing, affecting thus the accuracy and precision of the analyte distribution significantly ( Figure 2). 26−28 Hence, it is vital to improve our understanding of noise and image resolution as well as how our selected evaluation procedures will affect the final result.
In general, sources of noise are manifold, including optical crosstalk within the optode (e.g., light guidance effects 9,26 and optode inhomogeneity 29 ). Further sources of noise are noise arising during image acquisition summarized as transduction noise or due to nonoptimal camera settings, for instance when the ISO value must be high or the exposure time long. 9 To cope with noise arising from the optode, different approaches for optode fabrication have been proposed. 29 Fischer et al. 26 presented a high-resolution optode based on a fiber optic faceplate consisting of millions of individual light-guiding fibers, which prevents optical crosstalk within the optode. In another approach, Kuḧl et al. 30 reduced the thickness of the O 2 optode to 1−2 μm (cf. Figure S1) and were thus able to produce an optode with particular high resolution for microscopic applications with a fast O 2 sensor response. 24 In addition to instrumental considerations, a few optimized evaluation approaches have been proposed to cope with noisy images, 20 and smoothing filters were introduced in image postprocessing to increase the signal-to-noise ratio. However, while being generally beneficial for reducing image noise, denoising filters can also lead to a loss of spatial resolution and therefore to a loss of important information about analyte distribution. Hence, a conflict arises between image resolution and noise reduction, especially when fine heterogeneities (mm−μm) should be resolved in complex samples.
In this work, we therefore address the question of how precisely we can predict the concentration of the target analyte at a single pixel level within a noisy chemical image and how selected denoising filters will affect the final result. Thus, we first introduce the reader to the concept of calibration-associated Figure 1. Camera measures light intensity at discrete locations for each color, yet all measurements include variation. (A) A sensor element is defined by a red pixel and its neighboring green pixels. (B) The sensor signal is the ratio of intensities of the two colors. (C,D) Representative sample of 70 000 pixels from an image acquired under homogeneous anoxic conditions demonstrates the variation in the green and red pixels and in their ratio. While variation in each channel could arise from an inhomogeneous light source or sensor thickness, the variation which remains in the ratio demonstrates that camera noise is the dominant source of variation. Mean and standard deviation (SD) are indicated above the histograms. determining the best estimate and a corresponding prediction envelope (shown in gray). For measurement analysis, the ratiometric intensity R 0 /R (horizontal dashed lines) is translated into a probability of the oxygen concentration (solid lines) using the Stern−Volmer fit. Horizontal error bars indicate the standard deviation around each best estimate. uncertainty in chemical imaging. We then use an oxygen optode to generate a calibration curve based on the Stern−Volmer equation and apply a Monte Carlo method to estimate the uncertainty propagation and amplification across this nonlinear calibration curve. To demonstrate the impact of the initial marginal noise for small-scale imaging, we image a sample with a steep oxygen gradient over a few millimeters and investigate the impact of different denoising filters on the final results notably on the accuracy of the oxygen penetration depth.

RESULTS AND DISCUSSION
The general purpose of this paper is to investigate uncertainty propagation in optical chemical imaging and to discuss the trade-off between high image resolution and noise mediation. This discussion is particularly relevant when optical chemical imaging is performed on small scales, for example, a few millimeters or even micrometers. The results shown in the main article refer to a platinum(II)-porphyrin based O 2 optode incorporating an optical isolation layer and when images are acquired with camera settings 2 ( Table 2), while information for other camera settings as well as additional studies complementing the main messages of the paper are shown in the Supporting Information.
2.1. Uncertainty Propagation along the Calibration Process. An overview of the initial measurement uncertainty resulting from random camera noise during image acquisition and its propagation along the calibration is shown in Figure 3 and summarized in Table 1. Throughout the analysis, we assume that the pixels within the images are homogeneously distributed and independent from each other, as the dominant variation is introduced by the camera chip. This assumption is supported by the analysis of noise correlation in homogeneous samples. Calibration images at constant O 2 concentrations contain stochastic white noise, which is uncorrelated among pixels, between red/green channels, and between subsequent images. At a bulk level, we assume a constant and homogeneous O 2 concentration over time and space. Following eq 3, the sample size of 273 900 individual pixels (830 × 330 pixels) reduces thus the experimental standard deviation of the mean (SDM) for the ratiometric signal to a fractional error (SDM/mean) of 0.01% for each calibration point. We are therefore confident that the initial values for the ratiometric signal are accurate (validated by the reference sensor; see Supporting Information) and close to their expected values (low SDM). The standard deviation SD of the initial ratiometric signal is also small for each calibration point, with a fractional error ranging between 3.2 and 3.6% relative to the intensity level and indicates thus that the sample values scatter homogeneously around the mean value without outliers distorting the average value ( Table 1).
The subsequent step of the calibration, the normalization of the signal ratio R 0 /R (cf. eq 1), affects both uncertainties (SD and SDM) in the same way. Both uncertainties increase on average by up to 80% compared to the initial value of the ratiometric signal uncertainty (Table 1). Model fitting, in turn, inherently introduces additional scatter since experimental data are correlated with theoretically driven models, in this case, the simplified Stern−Volmer model. The model fit, and the Monte Carlo simulation for nonlinear uncertainty propagation thereby estimates the average O 2 concentration and its dispersion for each acquired image of known O 2 concentration (calibration image). The thereby computed sample mean for the O 2 concentration corresponds well with the expected value for all calibration points, which is also indicated by the general low SDM (Table 1). However, toward higher O 2 concentrations, uncertainty propagation causes the sample mean of the O 2 concentration to deviate from the expected value with a relative error of 1−2%. The fractional error of the SD (SD/mean) is 15% at higher O 2 concentrations and increases at lower O 2  concentrations (>20%). This in turn, leads to an increased detection limit for the O 2 indicator. Consequently, for a sensitive detection of the O 2 concentration in the trace range, other specialized luminescence indicators are required, as it is not possible to measure equally accurately and sensitively over the entire oxygen range (0−100% air) with only one indicator. 31−34 2.2. Impact of Camera Settings on the Prediction Function. Camera noise cannot be avoided, but appropriate camera settings can reduce it, thereby enhancing the image quality. An important parameter defining the image quality is the light exposure, describing how much light reaches the camera detector. While under-/overexposure is usually avoided in photography to prevent image quality degradation and the acquisition of false signal values, fluorescence-based optical chemical sensing may require that the exposure is adjusted accordingly to acquire sufficient signal intensities. For a given optical configuration (LED, filter, etc.), two camera settings mainly control the image exposure: the exposure time (shutter speed) and the aperture (f-number). By comparing the image histogram and the corresponding tables in the Supporting Information ( Figure S2 and Table S1 to Table S3) and summarizing the uncertainty of the ratiometric signal as well as its propagation toward the O 2 concentration, it can be deduced that camera setting 2 (aperture 2.8, exposure 4 s) is the most favorable among the presented measurement settings and results in the lowest uncertainty in all calibration points. In other words, at "optimal" camera settings, such as setting 2, images are captured to achieve a high signal level for the individual color channels (red and green) without oversaturation. It must be mentioned, however, that the optimal camera settings determined here cannot be considered absolute but must be adapted to the respective experimental setup depending on the camera and the illumination sources used. Even though the average signal level of the initial signal ratio is not as high as for camera setting 3 (aperture 5), camera setting 2 features the lowest SD and SDM ranging between 0.06 (0% air) to 0.03 (100% air) and 1.15 × 10 −4 (0% air) to 6.11 × 10 −5 (100%), respectively (Table S1). However, increasing the shutter speed to double as done for the camera settings 1 (exposure 2 s; Table   2), results in underexposed images in which the camera noise amplifies leading thereby to an increased SDM (setting 1, 1.53 × 10 −4 (0% air) to 7.64 × 10 −5 (100%); setting 2, 1.15 × 10 −4 (0% air) to 6.11 × 10 −5 (100% air)). Through uncertainty propagation, the determined O 2 concentrations are hence less certain compared to camera settings 2. In addition, Table S1 to Table S3 show that while the shutter speed primarily affects the uncertainty, that is, SD and SDM, decreasing the aperture by half deteriorates the overall signal more significantly and degrades not only the uncertainty (SD and SDM) but also the mean calculated O 2 level (setting 3). In a direct comparison of camera settings 1 and 3, in which the aperture size is halved, and the exposure time is doubled, the SD of the ratiometric signal intensity R is higher for camera setting 3 for all calibration points (Table S1).
2.3. Noise Reduction due to Smoothing Filters. Image noise is an undesirable byproduct of image acquisition that obscures intrinsic information and degrades the qualitative and quantitative interpretation of an experiment. 35 In-camera algorithms translating captured sensor data into an image, or denoising algorithms applied for image postprocessing, face the challenge of determining whether measured differences in pixel values represent noise or real "photographic information". While the former should be reduced in the process, the latter must be retained, especially when imaging at a microscopic level requires high image resolution. Image processing algorithms thus tackle the challenge to find a trade-off between reducing unwanted noise to a minimum and preserving maximal spatial information.
A common method for mediating image noise during image postprocessing is to apply an image smoothing filter. The effectiveness of these filters depends on different parameters, including the type of the filtering function and the size of the pixel group used to average the pixel in its center (kernel). To investigate the impact of the smoothing filter on the image noise and the image resolution, we imaged an O 2 optode monitoring the O 2 concentration gradient between the anoxic water body and the oxic headspace ( Figure 7). Upon acquisition, the raw images containing the ratiometric signal intensities were smoothed with a Gaussian filter in three different ways and In each panel, the average O 2 concentration recorded by the O 2 optode is presented as a solid orange line and the respective standard deviation (SD) as a bright-colored area around the mean. The line width is 1 pixel, that is, 0.036 mm. In each panel, a reference depth profile recorded by the microsensor is shown as a black solid line. In each panel, an excerpt of the optode image is shown as a 2D insert to visualize the transition. Here, the size of the filter mask is set to 51 pixels, whereas the mask size for the image sequence is altered between 1 and 81 with an increment of 5 pixels. compared to the original, nonsmoothed image: (i) along the horizontal axis, (ii) along the vertical axis, and (iii) with a squared mask in both directions. Further side studies, applying the Gaussian filter at different stages along the data processing or implementing Savitzky-Golay filter functions instead of a Gaussian filter, can be found in the Supporting Information (section 5 and section 6).
The results of the smoothing approach using a Gaussian filter in different directions are presented 3-fold: Figure 4 and an interactive image sequence included with the Supporting Information illustrate the impact of the smoothing filter in qualitative terms. For demonstration purposes, the size of the filter mask is altered between 1 and 81 with a step size of 5 pixels in the image sequence. To compare the original images and the effect of the smoothing filter on the image quality, we highly recommend inspecting the animated image sequence in the appendix. Additionally, Figure 5 displays the O 2 penetration depth (O 2 concentration < 5% air) as a quantitative parameter to describe the impact of the smoothing approach on the image resolution and the accuracy of the measurement results.
The standard way to denoise images is to apply the filter along both axes to ensure consistent treatment of all pixels. However, as can be seen in Figure 4C or rather in the image sequence in the Supporting Information and Figure 5, this approach sacrifices the resolution of the O 2 concentration gradient. Even though the average O 2 concentration coincides well with the microsensor profile at the beginning, the smoothing results in a deterioration of the optode profile with a larger filter mask. Furthermore, the O 2 penetration depth as a measure of image resolution and result accuracy increases with the size of the filter mask resulting in a penetration depth of 0.50 mm (filter mask width of 81 pixels) compared to the initial penetration depth of 0.12 mm (filter mask width of 1 pixel). Consequently, essential information is being lost, which is however intrinsically vital for high-resolution imaging at the microscale.
However, besides the risks that face denoising methods, they can be beneficial when applied in the right way. As Figure 4 and the image sequence in the Supporting Information show, the Gaussian filter applied only along the horizontal axis mainly affects the noise, that is, the standard deviation (SD) of the depth profile. The noisy signal of the recorded O 2 depth profile improves in accuracy, and the O 2 concentration transition remains unchanged even with a larger filter mask, demonstrating thus the beneficial effects of the denoising method. The depth profile, in particular underneath the surface and at the transition phase, coincides well with the O 2 profile recorded by the microsensor. The deviation of the optode profile from the microsensor above the surface, however, can be explained by different effects, an optical crosstalk within the optode due to light guidance, a smearing effect occurring at the meniscus of the water surface, and a signal blur due to oxygen diffusion in the sensing chemistry (cf. Figure S1). 26,30 The image resolution described in terms of O 2 penetration depth also displays the beneficial effect of this approach as can be seen in Figure 5. Both the microsensor and the optode upon horizontal image smoothing feature a similar penetration depth of 0.11 mm and 0.14 mm on average, respectively. The small offset between the microsensor and the optode results from metrological constraints, since it was not entirely possible to define the exact same surface depth for both sensors.
In contrast, the smoothing filter applied only along the vertical axis demonstrates the risks of noise reduction ( Figure 5). Also in this case, the signal becomes smoother, and the SD is reduced compared to the original image, however, the noise reduction  has a significant impact on the image resolution, in particular at the anoxic−oxic transition. Even a small filter mask with a width of 15 pixels (0.53 mm) leads to a noticeable deterioration of the image resolution as can be seen for the penetration depth in Figure 5. At this mask size, the penetration depth increases from 0.12 mm to 0.16 mm which corresponds to a relative error of 27.30% compared to the original image. Moreover, the image sequence in the Supporting Information demonstrates how a misapplied smoothing filter for noise reduction can distort the general shape of the O 2 gradient profile.
Furthermore, as shown in Figure S6, it makes no difference to the calculated penetration depth whether the smoothing filter is applied to the individual color images (red and green), to the ratiometric signal R, or the normalized signal R 0 /R later in the course of the data analysis. This observation is especially true, when the size of the filter mask is in the range of the expected penetration depth.
However, the type of filter function chosen affects the penetration depth, as shown in Figure 6 and in Table S6, although it should be noted that in our study no difference was found between a second and third order polynomial function for the Savitzky-Golay filter, apart from the fact that more pixels are needed for the latter. In the case of horizontal smoothing, the result for the penetration depth generally improves, meaning the horizontal smoothing leads to a similar result compared to the depth determined by the microsensor, especially when the length of filter mask increases. This trend corresponds to what is shown in Figure 4 (filter mask 51 px or 1.8 mm) and the image sequence in the Supporting Information. In general, however, the determined penetration depth of the smoothed images is significantly larger than that of the nonsmoothed images ( Figure  6A), although the differences between Gaussian filters and Savitzky-Golay filters are marginal (see Table S6). In the case of a square filter mask or when the smoothing is applied along the vertical axis, the Savitzky-Golay filter yields better results, that is, the determined penetration depth is closer to the depth determined by the microsensor, especially for larger filter masks ( Figure 6B,C). Here, it is important to point out that the vertical smoothing ( Figure 6B) leads to better results than the nonsmoothed images when the filter mask is in the range of the penetration depth. The results deteriorate only when the filter mask increases and are then far off the reference value. The situation shown in Figure 6A,B perfectly exemplifies the discussed dilemma. It may be advantageous to smooth noisy images to improve results and, for example, to determine the depth of penetration in heterogeneous images at the best possible spatial resolution. On the other hand, a smoothing filter must not be used without caution, otherwise relevant information will be distorted or even lost.

CONCLUSION
We report the impact of random camera noise on the final prediction function for chemical imaging and demonstrate its propagation along the calibration process for well-established ratiometric O 2 imaging. First, we investigated how measurement uncertainties propagate and amplify along the nonlinear calibration process (Stern−Volmer fit) using a Monte Carlo simulation and demonstrate how unfavorable camera settings impact the camera noise even further. We demonstrated how unavoidable image noise produces an imprecise calibration curve (Figure 2). We further demonstrated how an optical isolation layer ( Figure S4, Table S4) or optimized camera settings (Table S1) can reduce the image noise. Notably for the latter, we emphasize that although the absolute values of the uncertainty propagation depend on the specific camera or the general illumination of the experimental setup, the described trend remains the same.
Second, we demonstrated how image smoothing, as a common approach for noise reduction, can reduce noise, but it also ultimately affects the image resolution. For demonstration purposes, we investigated the impact of image smoothing filters on quantification of a steep O 2 concentration gradient over a few millimeters between an anoxic water body and an oxic headspace. This simple example demonstrated how prior knowledge of a sample allowed the selection of a onedimensional Gaussian filter to reduce noise while maintaining resolution in the direction of the chemical gradient. In the absence of such prior knowledge, more advanced filters such as anisotropic diffusion 36,37 could be applied to chemical imaging. In addition, our tests have shown that while the stage when the smoothing filter is applied during data processing is less influential, the selection of the filter function is very much so. On the basis of our findings ( Figure S7), it thus appears that it is more advantageous to use a Savitzky-Golay filter for noise reduction than a Gaussian filter, even though the former is to date underutilized and not yet well established.
The trade-off between noise reduction and image resolution is critical for precise understanding and quantification of the information revealed by chemical imaging. These considerations become increasingly important when imaging samples with resolutions from millimeters down to a few micrometers, as reduced dimensions and light intensity lead to significant image noise at reasonable exposure times. We hope that our study will support improved quantitative analysis of chemical imaging data, both as a refresher for experienced researchers and as an example for newcomers to the field.

MATERIAL AND METHODS
The main purpose of this article is to estimate the measurement uncertainty resulting from optical chemical imaging and its propagation along the calibration/evaluation process. Therefore, we focus on the imaging setup and image analysis; further information on the fabrication of the optode, a general description of the optode calibration, and a description of the concentration gradient experiment can be found in the Supporting Information.
4.1. Imaging Setup. The imaging setup consisted of an LED light and a digital RGB camera as a readout system. The images were taken with a single-lens reflex (SLR) camera (EOS 1300D, Canon, Japan) onto which a macro-objective lens (Macro 100 F2.8 D, Tokina, Japan) was mounted and set to a final image resolution of 712 dpi (280 pixels per cm). To minimize background fluorescence, a plastic filter (#10 medium yellow; LEEfilters.com) in front of a round orange 530 nm longpass filter (OG530 SCHOTT, 52 mm × 2 mm) was attached to the front of the objective lens. For excitation of the O 2 optode, a 470 nm UV LED (r-s components, Copenhagen, Denmark) was used together with a short-pass filter to avoid optical crosstalk between LED and camera. The LED was connected to the computer via a USB-controlled LED driver unit (trigger box, imaging.fish-n-chips.de) and the entire imaging setup was controlled by the software look@RGB (imaging.fish-nchips.de). To investigate the influence of camera settings on the camera noise, images were acquired with three different camera settings (Table 2).

Image
Analysis. Images were analyzed following an intensity-based ratiometric approach. 7 To perform the ratiometric approach, the software look@RGB splits the images into their respective color channels (red, blue, and two green channels) and the ratiometric signal R was calculated by dividing the red by one of the green color channels, according to the fluorescence emission spectra of the indicator and the reference dye, respectively (cf. Figure 1). The ratio R was then correlated to the O 2 calibration according to a simplified Stern−Volmer Fit: 38,39 R for the normalized ratiometric signal determined by dividing the anoxic ratio R 0 by ratio R, where K sv is the Stern−Volmer quenching constant and f and (1 − f) are the quenchable and nonquenchable fraction of the immobilized indicator. This method is well established in optical chemical sensing, and further information on intensity-based O 2 imaging can be found in the literature. 7,40,41 For more details on the oxygen calibration, including the actual oxygen concentration for each calibration point, refer to the Supporting Information, for example, Table S1. 4.3. Uncertainty Propagation. The Guide to the Expression of Uncertainty in Measurement (GUM) provided by the Joint Committee for Guides in Metrology (JCGM) is the definitive document for assessing measurement uncertainty and its propagation along the calibration process. The GUM summarizes international accredited definitions and rules for evaluating measurement uncertainty. 35,42,43 All parameter definitions and methods for uncertainty propagation used within this paper are taken from this guide. Definitions and approaches taken from other sources are marked accordingly. For clarification and illustration of the mathematical meaning of the definitions, reference is made to Figure 2 Experimental Standard Deviation (SD). A statistical measure of the dispersion of results from the expected value for a series of the same measured parameter. The experimental standard deviation SD is calculated as follows: where x i is the result of the i-th measurement and x is the arithmetic mean of n repetitions considered. Experimental standard deviation of the mean (SDM) considers the variability of sample deviations within the measurement and relates this variability to the sample size.
Following the theorem of large numbers, the experimental standard deviation of the mean SDM is n SDM SD = (3) where SD is the experimental standard deviation of n repetitions considered. In the literature, the SDM is often referred to as the standard error of the mean (SEM), although this is not correct according to the GUM.
Probability Density Function (PDF). The PDF of a continuous random variable X derives from the distribution function and describes the relative likelihood that the value of the random sample x i equals that sample point. The PDF is used to construct probability distributions using integrals and to study and to classify probability distributions. It thus considers any influence on the measurement result, for example, the ratiometric signal of the optode.
Expectation Value. Best estimate of the probability density function to describe the correlation between the O 2 concentration and the signal ratio using a simplified Stern−Volmer fit (eq 1) as it is the common standard in optical chemical sensing of O 2 dynamics.
Image Resolution. Description of how many details can be seen in the image. Quantitative parameters for image resolution include among others pixel resolution and spatial resolution. Pixel resolution describes the number of effective pixels of a digital camera contributing to the final image, and the number of photodiodes, that is, pixel sensors, is a multiple of the pixel number itself. The more practical parameter, however, is the spatial resolution, which describes how close two lines in an image can still be resolved. The spatial resolution is influenced by image generation processes and image postprocessing techniques.
Image Noise. An unwanted byproduct of image acquisition that disguises the intrinsic information and degrades the actual image resolution. While noise related to incorrect settings, such as shutter speed or other exposure settings, can be avoided by preshooting, random image noise or noise related to the camera technology itself (banding noise) cannot be controlled.
4.3.2. Uncertainty Propagation along the Calibration Procedure. To investigate the impact of the initial uncertainty on the final result, the uncertainty propagation was estimated in the following way. First, the signal ratio R was determined for each calibration point as described in section 4.2. On the basis of visual inspection, a homogeneous area was selected within the optode scene and averaged to obtain the initial measurement signal ( Figure 1C). The standard deviation SD and the standard deviation of the mean SDM were calculated according to eqs 2 and 3 ( Figure 1D).
In the following step of the calibration, the normalization of the ratiometric signal R 0 /R, the uncertainty propagation was determined according to Taylor 27 for linear functions: where q is the total uncertainty of the normalized signal ratio R 0 / R, and ∂R and ∂R 0 are the individual uncertainties of the variables R and R 0 . The uncertainty ∂q corresponds to the experimental standard deviation SD, while the corresponding experimental standard deviation of the mean SDM can be derived according to eq 3. The ratios ∂q/∂R and ∂q/∂R 0 are the derivatives of the uncertainty q with respect to the signal ratio R and the initial signal ratio R 0 , respectively, under anoxic conditions. In the subsequent fit process, the normalized ratiometric signal R 0 /R is correlated with the oxygen concentration according to the nonlinear Stern−Volmer model (eq 1), while calculating the uncertainty propagation from the signal ratio to the oxygen concentration. The purpose of the fit is to find optimal values for the fit parameters f and K sv . Since the fit parameters themselves are subject to uncertainty, we first determine the uncertainty of these fit parameters using eq 1, assuming well-defined values for the oxygen concentrations. Then, we calculate the uncertainty propagation toward the oxygen concentration with respect to all contributing sources of uncertainty, that is, the uncertainty of the ratiometric signal intensity as well as the uncertainty of the fit parameters. However, since the Stern−Volmer fit is a nonlinear calibration function, it is not possible to determine an analytical solution for the uncertainty propagated to the oxygen concentration. 42 Therefore, we estimated the uncertainty using the Monte Carlo method as a numerical approach. The Monte Carlo method iteratively selects random values for each PDF of each input parameter, thereby numerically determining the uncertainty. 35 According to the central limit theorem and the law of large numbers, the mean value of the numerical result converges toward the expected value. 44 The estimation of the uncertainty propagation requires the best value for the fit parameters in eq 1 (K sv and f) and their corresponding covariance matrix. On the basis of these results, random samples are drawn for each parameter, assuming a normal multivariate distribution in which the mean value corresponds with the best value of the fit parameter and the standard deviation is determined from the covariance matrix. The O 2 concentration is then calculated for each point of the sample from the transformed eq 1. By subsequent calculation of the mean and the experimental standard deviations of the derived sample results, the Monte Carlo method provides an approximate solution of the expected value.
All calculations shown in this study were performed using Python 3.8.5. For estimation of the error propagation and in particular for the Monte Carlo simulation, the Python packages uncertainty (pythonhosted.org/uncertainties, version 3.1.5) and mcerp (pythonhosted.org/mcerp, version 0.12) were used. The final version of the Python code is openly available on GitHub (github.com/silviaelisabeth/Noise-vs-Resolution) and can be consulted for detailed information on the individual calculation steps. The data set used for calibration and measurement analysis is available online at Mendeley Data. 45 4.3.3. Noise ReductionReduce Uncertainty by Smoothing. An O 2 concentration gradient experiment was established between the air-filled headspace and the anoxic water body as described in the Supporting Information. Upon image acquisition, a smoothing filter was applied for image postprocessing to investigate the impact of denoising algorithms on random image noise as well as on spatial resolution. Here, either a Gaussian filter or a low degree polynomial Savitzky-Golay filter was used for smoothing.
A Gaussian filter is a denoising method convolving the image with a weighted function similar to a 2-dimensional Gaussian function: where x and y are the distance of the pixel of interest from the kernel center and σ is the standard deviation of the Gaussian filter. Each pixel of the image is thereby considered individually and adjusted in comparison to its surrounding pixels (kernel) to avoid rapid changes in intensity.
In contrast, a Savitzky-Golay filter is a 1-dimensional finite impulse response of polynomial order, described by the following equation where N is the number of convoluting integers used for normalization, Y j+i is the pixel of interest of the original data, and m is the length of the filter mask. The filter coefficients C i (convolution integers) are defined by the chosen polynomial order and are listed in the publication by Savitzky and Golay. As for the Gaussian filter, each pixel is considered individually and adjusted in comparison to its surrounding pixels (defining the filter mask).
To investigate the effect of smoothing filters on the image noise and (spatial) resolution, the smoothing filters were applied to the measured O 2 concentration gradient between the anoxic water body and the oxic headspace. The smoothing filters were applied along both the horizontal and vertical axis, and as a squared filter mask with a filter width varied between 1 and 81 pixels at a pixel spacing of 5. Initially, the filters were applied to the ratiometric signal intensity after dividing the red by the green color images. However, to further investigate the impact of the smoothing filter on the O 2 concentration, we applied the smoothing filters at different stages during the image processing. Thus, we applied the filters to the individual color images, the ratiometric images R, and the normalized ratiometric images R 0 / R. Further information on this can be found in the Supporting Information. The corresponding filter function for the Gaussian filter (GaussianFilter) was taken from the Python package openCV (github.com/opencv, version 4.5.1.48), while the Savitzky-Golay filter (savgol_filter) was taken from the Python package SciPy (scipy-cookbook.readthedocs.io, version 1.7.1).
After application of the smoothing filters, a depth profile was drawn as shown in Figure 7 at an image width of 3 mm from the oxic headspace to the anoxic water body with a line width of 1 pixel, that is, 0.036 mm. The O 2 concentration profile was validated against a fiber based O 2 microsensor (see Supporting Information).
Effect of sensor film thickness on image resolution, optode preparation and fabrication, impact of camera settings and optical isolation on the ratiometric signal and its uncertainty (PDF) Image sequence to demonstrate the effect of smoothing filter and noise reduction using a Gaussian filter horizontally, vertically, or two-dimensionally (AVI)