1 Introduction

Ghost imaging (GI) is a novel non-local imaging technique, which originated from the study of entangled photon pairs. Not limited to this, classical light source has also been proved to be able to realize GI. Among them, pseudo-thermal GI is a classical and easy method to realize GI. Specifically, two correlated optical beams are generated by rotating ground glass and beam splitting prism, one of which is directly collected by the array detector, and the other is collected by the single pixel detector after the beam hits the object. The object information can be obtained by correlation measurements between these two detectors, but not either one alone [1, 2].

Pseudo-thermal GI has been proven to be capable of high detective sensitivity, high resolution and high noise resistance, and a lot of work has been done in physical research and practical application [3,4,5,6]. Although the computational GI [7,8,9] method based on spatial light modulation devices (e.g., digital micromirror device (DMD), spatial light modulator (SLM), etc.) simplifies the experimental setup of GI, it is also unable to withstand the application of high-energy laser sources for detection and remote imaging due to the low damage thresholds of DMD and SLM. Therefore, the ground glass with high damage threshold is one of the better light field modulation devices to realize the far-field target recognition detection and GI lidar. Oriented on practical application requirements, the key technologies with strong pertinence and demonstration verification have been reported in recent years [10,11,12,13,14,15,16,17,18,19,20,21]. For example, from kilometer level GI to three-dimensional pseudothermal GI of tens of kilometers, and then to near-infrared three-dimensional GI, which is conducive to promoting the application of GI in the field of battlefield reconnaissance, automatic driving, 3D non-invasive biological imaging and so on.

Recently, the demand of computer vision, target detection, remote sensing and other applications is growing, and the key link of the edge detection has attracted more and more attention. In traditional edge detection, an array detector (such as CCD, CMOS camera) take pictures of the target directly to obtain two-dimensional images, and the edge detection algorithm (such as Canny Sobel, etc.) extracts edge information from the image directly. In complex environments or harsh conditions, the camera can not effectively obtain the target image, so the traditional edge detection method is difficult to obtain the edge information. However, the edge detection based on GI uses a single pixel detector to collect the total intensity value after the interaction between the modulated light field and the target scene, and obtains the edge information of the target through the collected one-dimensional measurement signal and the modulated light field. It has high application value in the application scene where the target image cannot be obtained effectively by using the camera directly.

Therefore, some edge detection methods based on gradient, subpixel-speckle-shifting, frequency spectrum, variable-size Sobel operator and other spatial light field control GI schemes have been reported [22,23,24,25,26,27,28,29,30]. The existing edge detection based on GI must be realized by coding design and regulation of spatial light modulation equipment with the edge information of the target only being obtained in a direct way. Given the fact that the long-distance imaging is often required for remote sensing detection and three-dimensional GI of TOF, and that the damage threshold of spatial light modulation equipment such as SLM and DMD remains not high, making it easier to cause irreversible damage to spatial light modulation equipment when using high-power laser light sources.

When it comes to long range application, the pseudo-thermal optical field generated by rotating ground glass with high damage preset is often employed to replace the optical field regulation of spatial light modulation equipment. The existing edge detection methods based on GI can not be implemented in the pseudo-thermal GI system. In consequence, we propose an edge detection method by using the pseudo-thermal GI experimental system directly instead of relying on spatial coding design with the aim of obtaining the edge information of the target. In other words, we use the joint iteration edge detection method to directly obtain the edge information of the target from the one-dimensional signal and pseudothermal light field. Moreover, this method can obtain the edge detection information and high-quality reconstructed image with limited measurement times. The effectiveness of the proposed method is also verified in pseudothermal three-dimensional GI system. Meanwhile, this method can be extended to multispectral and hyperspectral imaging and feature extraction applications.

2 Theoretical model

Based on the principle of pseudothermal GI, one single pixel detector is selected to obtain the echo signal after the pseudothermal field interacts with the target object. Let T(ij) (\(i=1,2,\cdots ,r\); \(j = 1,2,\cdots ,c\)) represent the target image. The echo signal \(D^{(m)},~(m=1,2,\cdots ,M)\) is collected by the single pixel detector after the modulated light field \(I^{(m)}(i,j)\) irradiates the target T(ij), where m is the number of measurement times,

$$\begin{aligned} D^{(m)}=\sum _{i=1}^{r}\sum _{j=1}^{c}I^{(m)}(i,j)T(i,j). \end{aligned}$$
(1)

In this part, based on the idea of iteration, we use regularization and guided filtering to realize GI and edge detection. In brief, this is a problem for solving the equation:

$$\begin{aligned} Y = AX, \end{aligned}$$
(2)

where \(Y = [D^{(1)},D^{(2)},\cdots , D^{(M)}]^T\), A is a measurement matrix composed of the modulated light field for M times, where each row is A one-dimensional row vector reorganized by the two-dimensional light field, i.e.,

$$\begin{aligned} A=\left[ \begin{array}{cccc} I^{(1)}(1,1) &{} I^{(1)}(1,2) &{} \cdots &{} I^{(1)}(r,c) \\ I^{(2)}(1,1) &{} I^{(2)}(1,2) &{} \cdots &{} I^{(2)}(r,c) \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ I^{(M)}(1,1) &{} I^{(M)}(1,2) &{} \cdots &{} I^{(M)}(r,c) \\ \end{array} \right] , \end{aligned}$$
(3)

and X is a K (\(K = r\times c\)) dimensional column vector composed of target functions T(ij), i.e., \(X = [T(1,1), T(1,2),\) \( \cdots , T(r,c)]^T\). Hence, the entire detection process can be described as:

$$\begin{aligned} \left[ \begin{array}{c} Y^{(1)} \\ Y^{(2)} \\ \vdots \\ Y^{(M)} \end{array} \right] = A_{M\times K}\left[ \begin{array}{c} X_1 \\ X_2 \\ \vdots \\ X_K \end{array} \right] . \end{aligned}$$
(4)

2.1 The proposed joint iterative edge detection algorithm for pseudo-thermal ghost imaging

To achieve high quality image reconstruction and edge detection, on the basis of Ref. [29], we propose a joint iterative edge detection algorithm for pseudothermal GI to study the edge detection and three-dimensional imaging. Specific algorithm steps are summarized as follows:

Step 1: Set the initial iteration image is \(X(0)=0\in \mathcal {R}^{K\times 1}\), the number of iterations \(t = 1\).

Step 2: Use projected Landweber iteration regularization to solve Eq. 4, and it can be expressed as:

$$\begin{aligned} X(t) = X(t-1)+\alpha DA^T(Y-AX(t-1)), ~t=0,1,\cdots , \end{aligned}$$
(5)

where, D is a linear operator satisfying some conditions, in this case D is the pseudo-inverse of \(A^TA\). \(\alpha \) is a gain factor, and here we set \(\alpha =1\). Hence, the reconstructed image \(X(1)\in \mathcal {R}^{K\times 1}\) is obtained and reshape it into a two-dimensional matrix, i.e., \(X(1)\in \mathcal {R}^{r\times c}\).

Step 3: Guided filtering is introduced to further process the image \(X(t)\in \mathcal {R}^{r\times c}\). Set \(I(t)=X(t)\), and the mathematical form of guided filter can be expressed as:

$$\begin{aligned} q_{ i}(t) = a_{ k}I_{ i}(t) + b_{ k},\forall _i\in \omega _k \end{aligned}$$
(6)

where \(I_{ i}(t)\) is the guided image, \(q_{ i}(t)\) is the output image. There is a local linear relationship between \(I_{ i}(t)\) and \(q_{ i}(t)\) in a window \(\omega _k\) at the pixel k. Let’s take the gradient of both side of Eq. (6):

$$\begin{aligned} \nabla q(t) = a_{ k}\nabla I(t). \end{aligned}$$
(7)

Such local linear model ensures that q has an edge only if I has an edge. Hence, the guided filter that contains both global edge and whole image information of the object is expressed as:

$$\begin{aligned}{}[q(t), a_{k}]=guide\ filter(I(t), x(t)),~~~t = 1,2,3,\ldots . \end{aligned}$$
(8)

where q(t), \(a_{k}\) are the output image and edge image respectively.

Step 4: Reshape \(q(t)\in \mathcal {R}^{r\times c}\) into a one-dimensional matrix, i.e., \(q(t)\in \mathcal {R}^{K\times 1}\).

Step 5: Set \(t = t+1\), \(X(t-1) = q(t)\in \mathcal {R}^{K\times 1}\), calculate X(t) via Eq. (5). Then reshape it into \(X(1)\in \mathcal {R}^{r\times c}\).

Step 6: Set \(I(t)=X(t)\), calculate \(q(t),~ a_{ k}\) via Eq. (8). Then perform Step 4.

Step 7: Repeat Step 5 and 6 until high quality reconstructed image and edge detection results are obtained.

3 Results

To verify the effectiveness of this scheme for edge detection of pseudothermal GI and test its edge detection performance, we first carried out experiments on the transmitted target object (double-slit). Speckle light field size recorded by reference optical path camera is \(200\times 200\) pixels. We used the pseudo-thermal light field generated by rotating ground glass and the corresponding bucket detection value signal containing the double-slit object information for the calculation of the joint iterative edge detection, and the result is shown in Fig. 1. It can be seen from the results that we have successfully realized the imaging and edge detection of pseudothermal light field. When the number of measurement is 100, only partial object information of double-slit is obtained. And, the shape and edge detection results of double-slit imaging have partial distortion at 200 measurements. But the double slit feature of the imaging information is still recovered. When the number of measurements is increased to 300 and 400, high-quality double-slit imaging and edge detection can be achieved. It shows that this method has good performance in edge detection and imaging of pseudothermal GI of transmitted target object.

Fig. 1
figure 1

Reconstructed images obtained at different measurement times. The first row is the reconstructed image results, and the second row is the edge detection results

From this result, it can be seen that the joint iteration edge detection based on pseudothermal GI has the advantage of reducing the amount of data compared with the traditional edge detection method in practical applications. For example, taking the double-slit object in Fig.1 as an example, if we use the traditional method to shoot an image of \(200\times 200\) pixels with the camera and then detect the edge, we can detect 320,000 bits of data, that is, we need to detect these data to get the edge through edge detection. In the pseudothermal GI, we can distinguish the edges of the double-slit image in 400 single point measurements. At this time, the data amount is 3200 bit, which is 100 times less than that of the traditional method. This also shows that edge features and image information can be obtained by joint iteration edge detection with very few measurement times, so the imaging results and edge detection results are not as good as those with high measurement times. In addition, it is difficult to achieve target imaging and edge detection in the case where these data amounts are collected by the camera in the traditional case. Therefore, our method shows advantages over traditional edge detection methods in measurement, imaging, data volume, etc.

Fig. 2
figure 2

Three-dimensional pseudothermal ghost imaging experimental system. BS beam splitter, RGG rotating ground glass, PMT photomultiplier tube, SPD single photon detector

To further verify its effectiveness in the pseudo-thermal three-dimensional GI experimental system, we built an experimental system based on time of flight. Pulse laser with central wavelength of 532nm was selected as the light source. The laser irradiation on rotated ground glass produces a pseudothermal light field. A splitter prism divides the pseudothermal light field into two beams, one of which is directly captured by a CCD camera (Flir, GZL-CL-41C6M-C) and the other is projected to the target scene by an optical emission system. After the interaction between the pseudothermal light field and the target scene, the echo signal is converged on the photomultiplier tube (Hamamatsu, H10721-20) by the optical collection system. The photomultiplier tube is used to receive the echo signal and is amplified by the current amplifier (Femto, HCA-20M-100K-C) before being collected by the digital acquisition card (NI, PCI-5153). The experimental system is shown in Fig. 2.

Fig. 3
figure 3

Imaging and edge detection results of the target object boat under different measurement times

First, the pseudo-thermal GI and edge detection performance of single target reflection object are verified. The speckle field recorded by a reference optical path CCD camera is \(128\times 128\) pixels, and the target object is a reflection film in the shape of a boat. The experimental results are shown in Fig. 3. When the number of measurements is only 300, part of the image information of the boat can be obtained, and almost all the edge information of the boat can be obtained. When the number of measurements is more than 500, the image information and edge detection information of the boat are obtained effectively, which shows that this method can still have high imaging and edge detection performance for the single target reflection object.

Fig. 4
figure 4

Imaging and edge detection results of the target object (capital letters TIO) under different measurement times

To verify its performance in three-dimensional imaging, we carry out three-dimensional target imaging and edge detection. We take three capital letters TIO at different spatial distances as three-dimensional imaging targets, and the detection light field is still \(128\times 128\) pixels. The experimental results are shown in Fig. 4. We have successfully obtained the whole image information and edge information while achieving three-dimensional imaging. And when the number of measurements is greater than 1000 times, near-perfect reconstructed images and edge information are obtained. It is shown that this method also has high imaging and edge detection performance in three-dimensional pseudo-thermal GI.

Fig. 5
figure 5

Imaging and edge detection results of the gray target object under different measurement times

To verify the performance of this method for edge detection of gray target, we use the pseudo-thermal light field collected by experiment to carry out the numerical simulation of edge detection of two gray targets. Firstly, we choose the gray-scale objects used to detect the horizontal, vertical, positive 45 degree and negative 45 degree edges of gray-scale objects to carry out the edge detection research of pseudothermal GI. The results are shown in the first through third columns of Fig. 5. The results clearly show that this method is still effective for the edge detection of the gray target. No matter in horizontal or vertical, positive or negative 45 degree edge detection, it shows high information acquisition ability, especially in the case of only 1000 measurements, perfect edge detection and image reconstruction results are obtained. Then, more complex gray targets were tested, and the results are shown in the fourth to sixth columns of Fig. 5. At low measurement times, the edge information with different gray difference is effectively obtained, and only 1400 measurements are used to obtain the original gray image and the ideal edge detection results.

4 Conclusions

In this paper, we have proposed and demonstrated a joint iteration edge detection for pseudo-thermal GI method. It makes up for the deficiency that the existing edge detection method based on GI can only be used to computational GI of space light modulation equipment, but can not be applied to GI of pseudo-thermal light. The performance of simultaneous acquisition of image information and edge information from transmission, reflection and three-dimensional pseudothermal GI is verified by experiments. Experimental results show that this method can obtain high imaging and edge detection quality at lower measurement times. This work is helpful to promote the practical application of GI in target recognition, three-dimensional, remote sensing and other fields.