1 Introduction

Over the last two decades, the ghost imaging (GI) technique has attracted considerable attention [14] as an alternative to conventional camera-based imaging techniques, mainly owing to the rapid progress of spatial light modulators [5, 6] and digital mirror devices [7, 8]. In GI, the optical properties of a two-dimensional object such as transmittance, reflectance, and scattering are obtainable using a bucket (or single channel, or often called single pixel) detector. An image of the object is reconstructed by statistical data processing for the time series data obtained from the detector, which is sometimes referred to as computational GI (CGI) [5, 9]. Such a technique makes it possible to not only simplify the optical setup but also lower the detection limit. Furthermore, the observation of high-speed repeatable phenomena might be possible that would otherwise be impossible owing to the upper limit of the frame rate of a conventional camera.

The idea of GI (or CGI) arose in the field of quantum optics concerning the study of the entanglement of a pair of twisted photons [13]. GI enables robust measurements against noise owing to statistical correlation processing between a known reference and an unknown object intensity field. Thereafter, the technique was applied for image measurements, where a speckle interference pattern was used as the reference field [10, 11]. The capability of using a thermal light source has also been reported [4, 12]. Since the correlation procedure involves the ensemble averaging of many images, GI is expected to outperform the conventional scan-based imaging (SI) technique, especially in the case of an ultralow light level or a high background light level. Measurements under low light level conditions are strongly desired for observing living cells by a microscope since cells are photosensitive and easily photobleached by intensive illumination light. Measurements under a high background light level are also required in the fields of solar and cosmic telescope measurements. In any case, GI is promising for such situations with a low signal-to-noise ratio (SNR).

Hadamard transform imaging (HTI) is one of the most popular single-channel imaging techniques [13, 14]. In HTI, the intensities of light passing through a series of spatially coded masks, i.e., Hadamard masks, and an object are measured sequentially as time series data. Then the object image is reconstructed by performing an inverse Hadamard transform. HTI gives inherently the same information as an orthogonal transform imaging technique, which has often been used in the field of compressive sensing (CS) [15, 16]. Although CS also employs a single-channel detector and resembles CGI and HTI, its applicable conditions for reconstructing the image of an object are different: CS takes advantage of the sparsity of information on the target object.

However, both CGI and HTI are similar in terms of their applicable conditions and performance. It is well known that HTI has a multiplex advantage when thermal noise (or detector noise) is dominant but not when shot noise is dominant [14, 17, 18]. Regarding this point, the results of CGI based on a numerical correlation might have some discrepancy. To the best of our knowledge, no clear experimental results and discussion on this issue have been reported. However, apart from the discussion on the issue, it is practically important to compare the quality of reconstructed images between CGI and HTI under various SNRs at the output of the detector, particularly especially under low-SNR conditions.

In the present paper, we define a contrast ratio (CNR) as a measure [19] for the quantitative comparison of images reconstructed by CGI, HTI, and SI. We then report the results of numerical simulations and experiments. Finally, we conclude that HTI and CGI are superior to SI and useful in high- and low-SNR situations, respectively.

2 Principle of CGI and HTI

Here, we give a brief explanation of CGI and HTI, which have been described in detail elsewhere [5, 14]. In CGI, the intensity B r of the output signal from a bucket detector is given by

$$b_{r} = \iint_{s}{{I_{r} (x,y)}\;T(x,y)\;{\text{d}}x{\text{d}}y,}$$
(1)

where I r (x, y) represents the rth random pattern illuminated on an object, (x, y) are orthogonal coordinates, and T(x, y) is the transmittance of the object. The integration should be carried out on the object plane S. I r (x, y) is given in advance for r = 1, 2, 3,…, n, where n is the total number of illuminations. In early GI, an analog-valued statistically random pattern, such as an interference speckle pattern, was often utilized as I r (x, y). However, we are able to employ a binary random pattern instead of an analog speckle pattern [8]. To reconstruct the object image, or to estimate T(x, y), the second-order correlation function G(x, y) is defined as

$$\begin{aligned} G(x,y) & \equiv \frac{1}{n}\sum\limits_{r = 1}^{n} {\left( {b_{r} - \left\langle b \right\rangle } \right)I_{r} (x,y)} , \\ & {\kern 1pt} \, = \left\langle {bI(x,y)} \right\rangle - \left\langle b \right\rangle \left\langle {I(x,y)} \right\rangle . \\ \end{aligned}$$
(2)

where the symbol \(\left\langle \cdot \right\rangle \equiv \frac{1}{N}\sum\nolimits_{r} \cdot\) denotes an ensemble average of n sequential measurements at each (x, y) element. Because b r is given by Eq. (1), G(x, y) approaches T(x, y) with increasing n. This is the mathematical key to CGI.

In HTI, n masks must be prepared from a Hadamard matrix for n sequential illuminations of an object. The Hadamard matrix is a square matrix with elements consisting of +1 and −1 with row vectors and column vectors mutually orthogonal. The Nth-order Hadamard matrix is generated routinely by the following procedure:

$$\varvec{H}_{N} = \varvec{H}_{{2^{t} }} = \varvec{H}_{2} \otimes \varvec{H}_{{2^{t - 1} }} = \left[ {\begin{array}{*{20}c} {\varvec{H}_{N/2} } & {\varvec{H}_{N/2} } \\ {\varvec{H}_{N/2} } & {\varvec{ - H}_{N/2} } \\ \end{array} } \right],$$
(3)
$$\varvec{H}_{2} = \left[ {\begin{array}{*{20}c} 1 & 1 \\ 1 & { - 1} \\ \end{array} } \right],$$
(4)

where l = 2, 3, 4,…, log2 n, and ⊗ represents the Kronecker product. Then, the n mask matrices used for the sequential illuminations are obtained as follows:

$$\varvec{H}_{ij} = \varvec{c}_{j} \varvec{r}_{i} \quad (1 \le i,j \le N),$$
(5)

where H ij is a matrix of size N × N obtained from the outer product of the jth column vector c j and the ith row vector r i in matrix H N . The indexes i and j indicate the (i, j) th matrix in the group of N × N matrices. Finally, replacing −1 with 0 in H ij , we obtain a binary mask pattern that can be used for HTI. Here the (p, q) element of each H ij corresponds to the spatial coordinate (x, y) on the object plane. If we exchange appropriate pairs of rows and pairs of columns in H N , we can obtain an orthogonal matrix whose rows and columns are aligned in increasing order of wavenumber. Although these two matrices have the same mathematical properties, it is sometimes convenient to use the latter for image processing. In the following, we employ the latter matrix.

For example, Fig. 1a, b shows sixteen (4 × 4) random mask patterns I ij used for CGI and the fourth-order patterns H ij used for HTI, respectively. In Fig. 1a, the intensity of light passing through the (i, j) th mask pattern and the object is given by I ijpq T pq , where I ijpq and T pq are the (p, q) th element of matrices I ij and T, respectively. ◎ denotes the product of the individual elements (p, q) of I ij and T. Similarly, in Fig. 1b as above, intensity of light passing through the (i, j) th mask pattern and the object is given by H ijpq T pq .

Fig. 1
figure 1

Sixteen 4 × 4 binary illumination patterns used for a CGI (random mask) and b HTI (Hadamard mask). Light passes through white pixels but not through black pixels, the values of which are +1 and 0, respectively

In CGI, the total light intensity b ij detected by a single-pixel detector through the (i, j) th random mask is given by

$${\mathbf{b}}_{ij} = \sum\limits_{p = 1}^{N} {\sum\limits_{q = 1}^{N} {{\mathbf{I}}_{ijpq} {\mathbf{T}}_{pq} ,} }$$
(6)

After performing n (=N 2) sequential measurements for each of the (i, j) and reordering them as r = (1,1), (1,2),…,(1, N), (2,1),…, (2, N),…,(N, 1),…, (N, N), we can obtain b r in Eq. (1). Then T pq can be estimated using Eq. (2).

On the other hand, in HTI, the total light intensity w ij detected by the single-channel detector through the (i, j) th Hadamard mask pattern is given by

$${\mathbf{W}}_{ij} = \sum\limits_{p = 1}^{N} {\sum\limits_{q = 1}^{N} {{\mathbf{I}}_{ijpq} {\mathbf{T}}_{pq} ,} }$$
(7)

After n (=N 2) sequential measurements, we can form a column vector w with N 2 elements. If we form a transmittance vector t from the object pattern in the same manner as w, the relation w = H N t holds. Then we can derive t analytically from the inverse Hadamard transform: t = H −1 N w. Finally, we can obtain matrix T by rearranging vector t as a matrix form T.

3 Numerical simulations

Numerical simulations were carried out to compare CGI and HTI together with conventional SI. The test object to be reconstructed was the square aperture shown in Fig. 2a, whose outer size and aperture size were 64 × 64 and 10 × 10 pixels, respectively. Varying the SNR of the time series data obtained from the detector, we reconstructed images by the three methods and evaluated their qualities. Here we assumed that the light level of the signal incident on each pixel was in the range of 0–1. Then we superimposed Gaussian distributed noise on it at the output of the detector. The center value and the variance σ 2 of the Gaussian noise were zero and 9 × 10−8, respectively. Defining the noise level as 2σ = 6 × 10−4, the light level of the signal was varied between 1.8 × 10−5 and 2 × 10−2, corresponding to SNRs from 0.03 to 33. For the three methods, we also conducted another simulation in which the same Gaussian noise but generated from a different source was superimposed on the signal at every pixel on the mask pattern as a background noise in addition to the detector noise.

Fig. 2
figure 2

Numerical simulation results: a square aperture used as a test object, whose outer size and aperture size are N × N = 64 × 64 and 10 × 10, respectively, b images reconstructed by SI, CGI, and HTI for n = 4096, where noise was added at the output of the detector, c the same as (b) but noise was independently added at each pixel on the mask in addition to the detector noise. For comparison, results for n = 100,000 are also shown for the case of CGI

To ensure a fair comparison, we assumed that one value was obtained from the detector per illumination and we fixed the total exposure time (or the number n) for the three methods. To evaluate the quality of the reconstructed images, we defined a contrast ratio (CNR) as

$${\text{CNR}} \equiv \frac{\left\langle A \right\rangle - \left\langle M \right\rangle }{\sqrt {\sigma_{A}^2 + \sigma_{M}^2}},$$
(8)

where <A> and <M> are the spatially averaged values of the reconstructed image on the aperture and the masked area, and σ 2 A and σ 2 M are their variances, respectively.

Figure 2b shows images reconstructed by the three methods, where noise was added at the detector. For the sake of clarity, we extracted the center part corresponding to 24 × 24 pixels. For CGI, two cases of n = 4096 and 100,000 are shown. The visibility of the images clearly increased with increasing n. Also, the visibility of the images reconstructed by CGI and HTI was enhanced in comparison with those reconstructed by SI. A notable point here is that the visibility of the images reconstructed by HTI n = 4096 is higher than that of the images reconstructed by CGI n = 4096 under high-SNR conditions, whereas the visibility is almost the same under low-SNR conditions. This result indicates that the numerical correlation used in CGI requires a large value of n to reconstruct an image, whereas HTI can provide a relatively accurate solution analytically by solving simultaneous equations. Figure 2c is the same as Fig. 2b but with noise added at each pixel on the mask in addition to the detector noise. In this case, the quality of all the images obtained was somewhat deteriorated in comparison with that in Fig. 2b. This is simply because the amount of noise was increased.

For a more quantitative comparison, we show a plot of CNR versus SNR for each method in Fig. 3a, where each plot corresponds to a result shown in Fig. 2b. The plot clearly indicates that HTI is superior to CGI under high-SNR conditions, but CGI is of use under low-SNR conditions when increasing n. A notable feature of the HTI n = 4096 curve is that it lies above the CGI n = 4096 curve for all SNRs. Furthermore, the HTI n = 4096 curve lies above the CGI n = 100,000 curve for SNRs exceeding 0.9, implying that in HTI the value of n required to attain the same CNR is about 24 times less than that in CGI. However, it should be noted that the improvement factor is dependent on the object. Figure 3b is the same as Fig. 3a but with noise independently added at each pixel of the mask in addition to the detector noise. The dependence of the CNR on the SNR is almost the same as that in Fig. 3a. However, the values of the CNR for all cases were somewhat deteriorated compared with those in Fig. 3a. This deterioration depends on the size of the aperture. This behavior is easily understandable: when the aperture is very small, HTI is effectively the same as SI. For CGI, the CNR can be improved by increasing n. In Fig. 3a, b, we also included a curve labeled HM n = 4096, which was obtained from the same numerical correlation procedure as CGI but using a Hadamard mask instead of the random mask used for CGI n = 4096. The plot of HM n = 4096 lies almost midway between the CGI n = 4096 and HTI n = 4096 curves. This might be due to the different mask employed. From these results, we can conclude that HM n = 4096 is superior to CGI n = 4096 under high-SNR conditions.

Fig. 3
figure 3

a Plots of CNR versus SNR for SI, CGI, and HTI for n = 4096, where noise was added at the detector, b the same as (a) but noise was independently added at each pixel on the mask in addition to the detector noise. For comparison, plots for CGI n = 100,000 and HT n = 4096 are shown

4 Experimental setup

A schematic of the experimental setup is shown in Fig. 4. A computer-controllable optical scanner (type PC140015, OPUS Microsystems Co.) equipped with a dual-axis galvanometer and laser diode (LD, emission wavelength; 635 nm, maximum power: 600 μW) was used as a light source for projecting the illumination mask pattern on an object. In the optical scanner, a two-dimensional scanning mirror can generate an arbitrary mask pattern. The diameter of the scanning mirror was ϕ = 1.2 mm and its scanning speeds for the fast and slow axes were 13,580 and 1565 Hz, respectively. In our series of experiments, we set an exposure time of 300 ms/pattern. The illuminated pattern was collimated by lens 1 (L1, focal length: f = 100 mm, F = 3.9) and projected onto an object. The illumination pattern resulted in a square of 250 μm/pixel on the object plane. The light flux that passed through the object plane was collected by lens 2 (L2, identical to L1) and detected by a silicon PIN photodiode (type S5971, frequency bandwidth: 100 MHz, Hamamatsu Photonics Co.). The output signal was then analog-to-digital converted (type PCIe-6320, resolution: 16 bit, sampling rate: 250 kHz, National Instruments Co.) through a low-pass filter with a time constant of 1.0 μs and fed into a personal computer. The 5 × 5 mm square aperture shown in Fig. 5a was used as the test object. The intensity of light incident on the detector was adjusted by an appropriate neutral density filter (NDF), as was the SNR of the incident light on the detector. In this setup, we conducted SI, CGI, and HTI experiments by changing the coding of the mask pattern.

Fig. 4
figure 4

Experimental setup for CGI, HTI, and SI employing a galvanometer-based projector unit. LD laser diode, L1, L2 lenses, NDF neutral density filter, PC personal computer

Fig. 5
figure 5

Experimental results: a square aperture used as a test object, b images reconstructed by SI, CGI, and HTI for n = 4096. For comparison, results for n = 100,000 are shown for the case of CGI

5 Experimental results

Figure 5 shows the experimentally reconstructed images obtained from each method under eight SNR conditions. The tendency of the observed results is almost in agreement with that of the numerically calculated results in Fig. 2. Under the low-SNR conditions, the images obtained from SI were degraded by noise; the ambiguous horizontal lines on the images are due to long-term fluctuations of the optical scanner. In CGI and HTI, it was possible to suppress this degradation as well as the random noise. Figure 6 shows a plot of CNR versus SNR for the experimentally obtained images shown in Fig. 5. For each method, the plot is similar to the numerically calculated plot shown in Fig. 3a. In the actual experiments, however, we could not reconstruct the image for SNRs below 0.03 because the resolution of the detector was insufficient to extract the signal information from the noise and fluctuations. In principle, the CNRs of CGS and HTI approach unity when n and the SNR become large.

Fig. 6
figure 6

Plots of CNR versus SNR for SI, CGI, and HTI for n = 4096. For comparison, a plot for CGI n = 100,000 is shown

6 Conclusions

A comparative study was carried out among computational ghost imaging (CGI), Hadamard transform imaging (HTI), and scan-based imaging (SI) under various SNR conditions. Our numerical simulations and experimental results showed that the visibility of images reconstructed by HTI was higher than that of images reconstructed by CGI under relatively high-SNR conditions for a fixed total number of illuminations n. However, under low-SNR conditions, CGI enables the visibility to be enhanced by increasing the value of n freely, whereas HTI has a restriction on the value of n. Although CGI and HTI have a similar performance, with their superiority over SI depending on the geometrical and optical properties of the target object, CGI may have the potential for reconstructing images in weak light.