## 4 Integrated Reflectance and Transmittance Imaging
### Image Acquisition and Pre-Processing  
The hyperspectral imaging prototype performs line scanning for acquiring reflectance and transmittance images simultaneously. The prototype is set up to accommodate both the needs for scanning speed and spatial resolution. Higher speed is desirable in practical applications, but it will sacrifice spatial resolution, possibly leaving undetected some small defects; while higher spatial resolution, on the other hand, can increase the workload of image acquisition and also result in an unmanageable data volume. For instance, in experiments for quality inspection of pickling cucumbers, the conveyor belt speed was set to 110 mm/s, and the camera was operated at an exposure time of 50 ms and a delay time of 50 ms [82]. As such, the prototype ran at a speed of 1-2 product items per second per lane, scanning a portion of each sample (about half of the surface area of the sample with the given exposure and delay times). This is acceptable, in terms of spatial resolution, for evaluation of color and size, whose variations within the scanning width are relatively small. Besides, fewer images are acquired for each sample, thus expediting the image processing. Figure 14a shows typical 2-D line scanning images acquired by the prototype with and without samples (i.e., cucumbers) present on the convey belts. The leftmost and rightmost parts of the images represent the two transmittance references and the middle the reflectance reference. Each horizontal and vertical lines in the images represent a spatial profile across the scan line at a specific wavelength and a full spectrum at a given location in the scan line respectively. Figure 14b show examples of the spatial profiles at the wavelength of 623 nm, corresponding to the two horizontal dashed lines in Figure 14a. The spatial profile without samples, compared to the one with samples, is characterized by high intensity peaks resulting from the conveyor belts. The acquired raw hyperspectral image first needs to be split into two separate images corresponding to each lane. If the split images is 'blank', indicating no sample present in the scene, it will be discarded from analysis; otherwise, the image is 'non-blank', containing sample information, and is kept. Consecutive 'non-blank' images between 'blank' images are identifying as coming from the same sample [82]. The split images are then processed for in-line spectral correction by dividing the spectra of references. Figure 14c shows the integrated reflectance and transmittance spectrum of the references and a sample spectrum, which correspond to the vertical dashed lines in the left lanes in Figure 14a. One notes that the integrated reference spectrum and the sample spectrum are divided into two parts for reflectance and transmittance, respectively, at the wavelength of 675 nm, which is the cut-off wavelength of the blocking filter installed in front of the reflectance illumination source. The spectral correction is performed line by line according to the equation as follows [82]:  
Figure 13: Schematic of reflectance and transmittance references for in-line light correction. \[I_{c}=\frac{I_{s}-I_{d}}{I_{r}-I_{d}} \tag{5}\]  
where \(I_{c}\) is the corrected sample spectrum, \(I_{s}\) is the raw sample spectrum, \(I_{r}\) is the integrated spectrum of the two reflectance and transmittance references and \(I_{d}\) is the dark-current spectrum. After completion of the reference-based in-line light calibration, further corrections for the effect of the fruit size on the transmittance measurement are needed. Since light attenuation within tissues is positively correlated with the optical pathlength, hence transmittance is affected by the geometry or diameter of the sample being detected.