Once all constraints and properties of our model are adequately defined, we must characterize the imaging system and verify that, indeed, it behaves as described. These results have been obtained from the device explained in
Section 2.2, and attempt to serve as an example of how to measure whether or not each component is being exploited to its maximum potential. Here, we shall focus on the elements of the reviewed model that have not been studied by previous work: (1) timing issues, (2) spatial distortions, (3) microstepping noise, and (4) overall efficiency.
3.1. Timing and Delays
Measuring time spent in each of the modeled operations is an adequate first step in characterizing system efficiency. In
Figure 5, the total time per line is partitioned between its essential tasks. For this experiment, each measured line is separated by a single motor step (i.e., the device is working at full resolution). This was tested at 8-bit and 12-bit depth, since bit depth will influence the total time spent transmitting data. As expected, with no other processes running in the system, transfer and buffer copying only take a small fraction of the total time, while a fixed time is spent communicating with the camera and the rest of the time is spent acquiring light.
By obtaining the inverse of this time per line, we can represent the rate of acquired lines per second of the scanning device. This calculation is shown in
Figure 6, where the dots represent the inverse of the bars in
Figure 5, and the continuous line is a nonlinear least squares fit to 1/(
Texp +
Textra), being
Textra the constant time parameter that we wish to estimate. Additionally, the ideal model, i.e., 1/
Texp, is shown as a dotted black line. The different graphs represent the average lines per second when parts of the system are disabled: the red plot represents normal acquisition, while in the case of the blue line the rotating mirror remains static (i.e., no serial commands are sent to the rotating mirror actuator) and, for the green line, only acquisition commands are being executed, and acquired images are discarded (not stored into memory). Driver and API delays are, in theory, constant values that can be shown to be due to runtime execution of precompiled dynamic libraries. Nevertheless, random variations in timing are clearly visible after adjusting for our model, and are related to OS schduler interruptions and multithreading management, since acquisition, actuator control, storage and RAM management are run by different processes. In order to obtain accurate, stable LPS measurements, we must use application-specific circuits, and/or real-time operating systems.
Additionally, it must be noted how, regardless of exposure time, all measurements are limited by the maximum FPS rate that the camera and/or network protocol can manage (49.5 FPS/LPS for 8 bits is limited by camera performance, 27 FPS/LPS for 12 bits is limited by network speed). All measurements are bounded from above from the value given by Equation (
2) due to network bandwidth, overheads in transmission, as well as transmission delays, router switching delays, and DLL runtime delays (which cannot be optimized since the Vimba API is already compiled and no source code is available). These issues produce an additional limit, as well as random acquisition speed variability. Some clinical approaches, like fluorescence quantification, will require 12-bit images, while other methods could benefit of much faster acquisition times rather than a higher pixel resolution; these issues should be considered in advance depending on the application.
A similar approach can be done for the other modalities shown in
Table 1, considering their ideal efficiency or throughput (
Table 6). For the spatial and spectral resolution considered in
Table 1, a rotating mirror scanning system would score favorably with respect to other modalities, considering that rotating a small mirror will take a shorter amount of time and less power consumption than displacing either the sample or the imaging system (i.e., as indicated in the table,
Tact ≪
Tmove).
3.2. Image Distortions and Noise
Since focusing optics are independent from the actuator subsystem in many cases, the object plane will inevitably suffer nonlinearities. A rotating mirror with a stepper motor will incur three types of measurement errors. First, the object plane will be curved, as the focusing distance will be fixed for any mirror angle; this curvature effect must be limited to a linear range, and its effects must be quantified. Second, there will be backlash in the transmission system that connects the motor to the mirror axle; such backlash can damage repeatability, and must be minimized. Third, and finally, there will be microstepping noise due to spurious currents in both driver and stepper rotor; those must be minimized by using an adequate stepper driver and microstepping factor.
Although we can model theoretical distortion due to mirror rotation and avoid exceeding its linear range of operation, overall distortion and noise can (and should) be characterized by imaging an Amsler grid with various lengths and forcing the rotating mirror to capture a half/quarter rotation at maximum resolution. Then, the first finite difference along the
y axis can be obtained, which allows for edge detection in the grid. The variation in grid cell width can be approximated by the nonlinear scaling factor of
Section 2.3.3, and therefore a nonlinear least-squares fit of Equation (
5) can be obtained. This deterministic distortion allows for obtaining
r, the total distance to our object, as well as isolating any remaining errors coming from other sources. The result of this calculation is left in
Figure 7. To obtain a successful alignment, an Amsler grid with 6 × 6 mm squares was printed at maximum resolution, screwed to an optical table, where a SMS20 Heavy Duty Boom stand/crane (Diagnostic Instruments, Inc., Michigan, US) was situated holding the instrument above the grid. Then, horizontal (
x-wise) alignment between grid and camera was achieved by constantly previewing the image and overlaying a series of horizontal lines in a custom-designed graphical user interface (GUI), moving and fixing the stand until centering and alignment of the center dot of the grid was achieved at
θ =
π/4 (or, alternatively,
γ = 0). The relationship between position
y and angle
θ is linear within the range ±
π/8 ≈ ±0.3926 and distortions in the
x axis can be corrected by an inverse affine transformation.
The residual in the right subplot shows a cosine-like pattern that is likely due to misalignment errors that cannot be compensated by the GUI and manual adjustment. While this non-random variation cannot be corrected any further without more precise equipment, random variations in
yd can still be accounted for by FFT clipping this signal down to its average noise spectral power density. The results of this experiment are shown in
Figure 8, where the left plot shows the variations in grid size beyond misalignment, and the right subplot presents a histogram and a Gaussian fit for an estimated mean
μ and variance
σ2. This variability is therefore in the order of
σ ≈ 0.2 mm at a distance of 348.73 mm and a FOV size of 120 × 120 mm, which can be considered negligible for far-field measurement.
3.6. Benchmark Results and Characterized Equipment
Once our image is as clear as possible, spectral information has been calibrated, and timing issues are well characterized, it is time to benchmark overall system performance. While LPS values show the maximum acquisition speed of the system, efficiency values (as described in
Section 2) will show how much the maximum LPS rates are throttled by time not spent in acquiring lines. For
Figure 13, the same LPS measurements are repeated and efficiency is plotted (scatter plots) and nonlinear least-squares fit to Equation (
3) (smooth line plots), for the three scenarios explained in
Section 3.1 and for 8- and 12-bit images. The behavior of this graph is expected, as efficiency is a monotonically increasing function with respect to exposure time, and rises quickly as less tasks take control of the main computer and spend time performing non-essential tasks.
Although efficiency can be seen as an indirect measurement of LPS rates, it can be considered an explicit benchmark in and of itself, since it only indicates the divergence between an ideal, theoretical measuring machine, and the device under test. It completely ignores every other specification of the system, and focuses on how much CPU time is dedicated to measuring only. Better cameras can be substituted in the system and its efficiency can be reevaluated, which facilitates device adaptation and updating to different acquisition environments. For example, higher efficiencies could be more practical in constantly moving environments (such as real-time, in-vivo diagnostics during a surgical procedure), while lower efficiencies can be sufficient for slower scenarios (i.e., ex-vivo imaging). Also, they could be used in industrial manufacturing as a way to quantitatively compare camera efficiency the various tradeoffs between resolution, gain, sensor quantum efficiency, network interface, and spectral range of operation, when selecting a sensor in a commercial device or process.
Another interesting conclusion is related to scanning hyperspectral devices as an imaging modality. Artifacts due to subject motion and/or metabolic changes, such as sample oxidation, changes in oxygenation, degradation, or decay will be more severe as the total time spent capturing is increased. While under these conditions other imaging modalities can prove more useful, a fair tradeoff between speed and resolution can be achieved in these systems, since the total time spent in an image with Nlines lines measured will be Timg = NlinesTline/ϵavg(Texp), where ϵavg(Texp) is the average measurement efficiency for a given exposure time. Consequently, the higher the efficiency, the smaller the number of uncorrectable artifacts that could be found in an image with an adequate choice of resolution and exposure time.
Finally, by assuming that the model takes into account all timing and nonlinearity issues, its final characteristics can be summarized, as in
Table 7. Understandably, some of its specifications (e.g., gain and exposure time ranges) are extracted from their parts’ corresponding tables, while the rest are a consequence of the benchmarks described throughout the article. Resolved distances, nonlinearity corrections, delays and efficiencies may be illuminating, for example, when comparing tradeoffs and similarities with known equipment, commercial or otherwise; both device manufacturers and applied optics scientists can compare, select, replicate and improve their systems, based on how well different parts perform together.
As for now, we can report on the protyping of a high-resolution, highly efficient hyperspectral imaging system, capable of 1.44 Mpx spatial resolution, 200 wavelength channels over the Vis–NIR range, fully modifiable optics, variable gain, exposure time and acquisition mode for HSI, SFDI, and SSOP measurements (as well as any additional experimental methods) which can be controlled via a RESTful Web Service from any computer within the laboratory network. An HSI image of a hand obtained with this device (
r = 350 mm,
Texp = 200 ms, full resolution), as well as some random spectra within the image, can be seen in
Figure 14. Color reconstruction is achieved via CIE 1931 Color Matching Functions (CMFs) applied on the acquired spectra, providing XYZ/RGB images with identical resolution. A near-infrared channel (
Figure 14b), namely 803 nm, reveals existing vascular structures in the hand. Some random spectra are also displayed at the bottom plot, with 1% transparency for each spectrum, to stand out repeated features (i.e., skin and background spectra) from unlabeled spectra.