*2.1. Image Formation and Image Processing*

In SFDI, image formation involves two steps [22]: (1) the incident light interacts with the sample through absorption and multiple scattering, and (2) the light reemitted from the sample travels through a series of optical devices (e.g., lens, camera) of the imaging system, and eventually forms a digital image. As a general rule, SFDI is regarded as a linear, space-invariant technique which applies transfer function theory to an optical imaging system [23]. There are several factors negatively affecting the resolution and contrast of resulting images during image formation and processing, such as convolution operation and environmental noise. A mathematical method is used to analyze the image acquired by SFDI, which is generally composed of two parts. The first part is DC, i.e., *IDC* with the Fourier spectra centered at the origin; the other part is AC termed as *IAC*, which is composed of an oscillatory or harmonic component, with the Fourier spectra shifted by positive or negative frequency (*fx* or −*fx*) [24].

The process of optical property estimation from the remitted image in the SFDI can be roughly divided into two steps: acquisition of diffuse reflectance image through demodulation and estimation of optical property mapping through inverse computation. Due to the characteristics of high accuracy and easy implementation, phase shifting techniques are widely used for demodulation from sinusoidal fringe patterns. Three-phase demodulation (TPD) is a commonly used and effective method that uses three images with the phase offsets of −2*π*/3, 0, and 2*π*/3. Under the illumination of three phase-shifted sinusoidal patterns, the corresponding intensity images, i.e., *I*1(*x*, *y*), *I*2(*x*, *y*)*,* and *I*3(*x*, *y*), can be expressed as follows [25]:

$$I\_1(\mathbf{x}, \mathbf{y}) = I\_{D\mathbb{C}} + I\_{A\mathbb{C}} \cos(2\pi f\_\mathbf{x} \mathbf{x} - 2\pi/3) \tag{1}$$

$$I\_2(\mathbf{x}, \mathbf{y}) = I\_{D\mathbb{C}} + I\_{A\mathbb{C}} \cos(2\pi f\_\mathbf{x} \mathbf{x}) \tag{2}$$

$$I\_3(\mathbf{x}, \mathbf{y}) = I\_{DC} + I\_{AC} \cos(2\pi f\_\mathbf{x} \mathbf{x} + 2\pi / 3) \tag{3}$$

where (*x*, *y*) represents the spatial coordinates, *fx* is the spatial frequency along the *x*-axis direction, and *IDC* and *IAC* are the direct and amplitude components, respectively. For the purpose of simplicity, we will drop off the coordinate notation. From Equations (1)–(3), the DC and AC images can be obtained by the following equations [15]:

$$I\_{DC} = \frac{1}{3}(I\_1 + I\_2 + I\_3) \tag{4}$$

$$I\_{A\mathbb{C}} = \frac{\sqrt{2}}{3} \sqrt{\left(I\_1 - I\_2\right)^2 + \left(I\_1 - I\_3\right)^2 + \left(I\_2 - I\_3\right)^2} \tag{5}$$

#### *2.2. Image Contrast*

Light penetration features are of primary concern for the demodulated images, which are also critical for fruit bruise detection. To our knowledge, it is challenging to assess the light penetration capability, because it is largely dependent on tissue physicochemical properties and illumination conditions. For the bruised apples illuminated under spatially modulated illumination with varying frequencies, light penetration capability could essentially determine the thickness of the tissue that light passes through. In this study, we introduce image contrast and the ratio of peak to valley's intensity (PVR) to evaluate the light penetration capability, which will be introduced in Section 3.2. Examination of the composition of photons backscattered from a turbid medium will provide qualitative insights into the relationship between light penetration depth and image contrast. The ballistic photons experience one or more backward and forward scattering events before exiting from the tissue. Due to the shortest traveling path, they suffer from minimal scattering and thus can deliver image information with superior resolution and contrast. However, the information generated by ballistic photons is more about the superficial layer of the medium in one mean free path (MFP) [26], around 100 μm for fruit tissue such as apple (assuming the value of *μ <sup>s</sup>* is equal to or larger than 1.00 mm−1). The weakly scattered photons provide information on deeper, subsurface tissues, and they are still capable of forming well-resolved images due to limited scattering events. In summary, the tradeoff should be carefully considered between the light penetration depth and image contrast, while selecting spatial frequency in SFDI [26,27].

The *IDC*, which contains a larger contribution of diffusive photons, probes a deeper region of sample tissues than *IAC*, while *IAC* contains more ballistic and weakly scattered photons, resulting in better image contrast [15]. High-frequency illumination is more likely to enhance image contrast. Presented in the following sections are well-designed experiments to quantitatively determine the relationship between image contrast and the depth-resolved imaging feature of SFDI.
