Edge detection based on joint iteration ghost imaging

Imaging and edge detection have been widely applied and played an important role in security checking and medical diagnosis. However, as we know, most edge detection based on ghost imaging system require a large measurement times and the target object image cannot be provided directly. In this work, a new edge detection based on joint iteration of projected Landweber iteration regularization and guided filter ghost imaging method have been proposed which can be improved the feature detection quality in ghost imaging. This method can also achieve high quality imaging. Simulation and experiment results show that the spatial information and edge information of target object are successfully recovered from the random speckle patterns without special coding under a low measurement times, and the edge image quality is improved remarkably. This approach improves the the applicability of ghost imaging, and can satisfy the practical application fields of imaging and edge detection at the same time.


Introduction
Ghost imaging (GI) is a novel optical imaging technology that is rather different from conventional modalities. In conventional optical imaging, the object image is directly acquired by a multi-pixel detector. Surprisingly, GI uses a single-pixel detector to detect the total light signal strength of object, while a detector with spatial resolution measures the information about the light source. The image can be retrieved merely by correlating the signals of these two detectors, but not either one alone [1]. Remarkably, GI has the superiority of higher sensitivity in detection and anti-atmospheric disturbance than conventional optical imaging [2]. Hence, GI is increasingly focused on its applications, such as remote sensing [3][4][5], optical coherence tomography [6,7].
Recently, edge information detection of target object for GI was considered [27][28][29][30][31][32][33]. Edge detection is widely used in computer vision, target recognition, earth observation and security check [34,35]. As we all know, traditional edge detection methods (e.g. Canny [36], Sobel [37], Roberts [38], etc.) rely on the original image. However, in many practical application scenarios in which harsh or noisy environments, the traditional edge detection methods are ineffective because the image information of the target object is difficult to obtain. Different from traditional edge detection methods, edge detection based on GI scheme can detect edge information directly without needing the original image. Hence, edge detection based on GI can solve the problem of disturbance due to its advantages on good anti-disturbance imaging and direct edge detection of unknown objects.
Here, some edge detection based on GI methods have been reviewed [27][28][29][30][31][32][33]. Liu et al. proposed a gradient GI (GGI) scheme which directly achieved the edge information of an unknown target object [27]. Subsequently, a more optimized edge detection method named speckle-shifting GI (SSGI) was reported by Mao [28]. The SSGI scheme does't need the gradient angle or any other prior knowledge of the object in GGI. Then, wang et al. [29] proposed another similar method called subpixel-speckle-shifting GI (SPSGI), which is based on a set of subpixel-shifted Walsh-Hadamard speckle pattern pairs and has the advantage of enhancing the resolutions of the edge detection. Meanwhile, Yuan et al. [30] used structured illuminations based on the interference principle to get edge information, and the method can extract the edges of binary and gray targets in any direction at the same time. From the perspective of light field coding, special sinusoidal patterns for the x-direction edge and also y-direction edge of the unknown object were designed by Ren [31]. Furthermore, a novel variable size Sobel operator whose coefficients are isotropic and sensitive to all directions was designed and used for edge detection based on GI by Ren et al, whereby the edge detection based on GI method could directly achieve the edges of an unknown object without choosing the gradient angle or any other prior knowledge of the object [32]. However, these methods still have some shortcomings, such as high measurement times and poor quality of edge information acquisition.
In order to improve the efficiency of edge detection based on ghost imaging, Guo et al. proposed a compressed ghost edge imaging (CGEI) scheme, which designed special random patterns with the characteristic of different speckle-shifting, and used compressed sensing technology and Sobel operator, whereby the measurements required for edge detection can be further reduced [33]. Noteworthy, these methods can only obtain edge information singly, unless the reconstruction calculation of the whole information is carried out again. If the edge information and the whole image information of the object can be obtained simultaneously at a lower sampling times, this will greatly promote the air surveillance and ocean monitoring application of GI. We find that the problem can be well solved by using the compressive GI based on guided filtering method [39].
In this paper, we demonstrate an edge detection based on joint iteration ghost imaging (JIGI) method for simultaneously acquiring the global edge and whole image information. Because the JIGI method is based on projected Landweber iteration regularization and guided filter, in which guided filter is an edge-preserving filter which can enhance the signal-to-noise ratio of edge detection, the proposed method have some benefits: 1) High efficiency: simultaneous acquisition of high quality edge and whole image information is implemented with fewer measurement times; 2) More convenient: edge detection can be realized in any light field without designing special light field and pair measurement; 3) Strong universality: it is not limited to computational ghost imaging using light field modulation equipment, but also suitable for other ghost imaging methods such as dual-path pseudo-thermal ghost imaging.

Theoretical analysis
In CGI system, the detection light source is generated from a light beam through a spatial light modulator (SLM) [or a digital micromirror devices (DMD)], and then passes through an optical lens to adjust the size of light beam. The transmitted or reflected light field I (m) (i, j) (m = 1, 2, 3, · · · , M represents the number of measurement times) passing through the target object with a transmission coefficient of O(i, j) is recorded by a single-pixel detector; and the detection value obtained from the m-th sampling is expressed as B (m) .
Here, by reconfiguring the elements of each speckle pattern (dimensions r × c) pre-generated by computer into a row vector of length K = r × c to form one row of the matrix Φ, we obtain the following M × K matrix, based on A measurements: The M results from the single-pixel detector can be permutated into an M × 1 column vector y: Then, if we denote the unknown target object O(i, j) as an K dimensional column vector x (K × 1), we will have the framework y = Ax, and the matrix form is expressed as: . . .

Step 1: projected Landweber iteration regularization
As we all know, some special regularization methods are exploited to solve Eq. (3), such as projected Landweber iteration regularization (PLIR) [39][40][41]. Here, we use PLIR to get the preliminary reconstructed image. The PLIR is defined as [41]: where P is the pseudo-inverse of A T A, ω is the gain factor to control the convergence speed, x t is the approximate solution of Eq. (3), and x t−1 is the approximate solution of the previous (initial supposition: x 0 = [0, 0, · · · , 0] T ). Let x t−1 := x 0 , and then we first obtain initial reconstruction image x 1 .

Step 2: guided filter
In order to realize the edge detection based on GI, the resulting image x 1 is reshaped K × 1 dimensions into a matrix of r × c dimensions and processed with a guided filter method. Here, we denote the guided filter as [42,43]: where x t is the filter input image (i.e., the reconstruction result of PLIR), I t is the guidance image (t = 1 : The filtering output at a pixel i is expressed as where i and j are pixel indexes. The filter kernel W i, j is a function of the guidance image I and is independent of x, this definition follows [42] where, x is the coordinate of the pixel, ω k is the k-th kernel function window, |ω| is the number of pixels in ω k , is a regularization parameter. Here, µ k and σ 2 k are the mean and variance of x in ω k .
In guided filter, it assumes that there is a local linear relationship between the guided image I t and the output image q ti in a window ω k centered at the pixel k: where (a k , b k ) are some linear coefficients assumed to be constant in ω k . Let's take the gradient of both sides of Eq. (8): Such local linear model ensures that q has an edge only if I has an edge. This model [Eq. (9)] has been proven useful in image matting [44], image super-resolution [45], and haze removal [46]. To determine the linear coefficients (a k , b k ), we minimize the following cost function in the window ω k : where, is a regularization parameter penalizing large a k . Using linear ridge regression method, the coefficient of Eq. (10) are obtained as follows: Here,x k = 1 |ω | i ∈ω k x ti is the mean of x in ω k . Ordinary, we average all the possible q ti values as the final q ti . Hence, after computing (a k , b k ) for all windows ω k in the image, we compute the filtering output by where, In order to obtain the edge information of GI, we add a k to the output of Eq.(5). Hence, the new guided filter that contains both global edge and whole image information of the object is expressed as:

Step 3: joint iteration
The output result q t of Eq. (15) in Step 2 is taken as the input image x t−1 of Eq. (4) in Step 1, i.e., x t−1 = q t . Then, follow the loop iterations from step 1 to step 2 until the output results q t and a k converges at high quality. In this way, the edge detection based on JIGI method is realized by joint iteration of PLIR and guided filter, which obtains the high quality edge and whole image information at the same time. The joint iteration process is shown in Fig.1. More specifically, in our edge detection based on joint iteration ghost imaging method, PLIR is used to constantly add limited information into the reconstruction results, which makes a small number of signals be fully utilized. Meanwhile, according to the result information of the PLIR and the detailed information of the guidance image (the previous guided filter output image), the whole image information and the feature information (edge information) of the image can be acquired. The mechanism for obtaining edge information through a k is explained in detail below. It is shown from the Eq. (11-12) that guided filter has the edge-preserving smoothing property [43]. First, let I t = x t . Then we rewrite the Eq. (11) as: where, Here, σ 2 k denotes the variance of region ω k , i.e., the local variance of the guidance image I ti . So, Eq. (16) can be further expressed as: This can be explained intuitively as follows. If the region ω k contains more texture and edge features, then a k becomes close to 1 on account of σ 2 k has a larger value. Contrary, if the region ω k is constant or relatively smooth, then a k becomes close to 0 because the value of σ 2 k is very small. From the above Eq. (16)(17)(18) can see, a k is the global edge information of output image q ti , and b k is the internal information (i.e., contains no edge information).

Performance evaluation
In order to objectively evaluate the performance of our edge detection method, the signal-to-ratio (SNR) is used, which is defined: where q edge and q back are the intensities of the edge detection result in the object edge and background region respectively, and var stands for the variance. At the same time, we use a peak signal-to-ratio (PSNR) to estimate the quality of edge detection image. The PSNR reads: where maxV al 2 is the maximum possible pixel value of the image and where O edge represents the original edge image consisting of r × c pixels, and a k denotes the reconstructed edge image.

Results
In this section, we will carry out the numerical simulation of GEGI method for different target objects, and select an aircraft model as the real object for the actual experiment. The original images (numerical simulation), speckle patterns and results image all have resolutions of 128×128 pixels.

Numerical simulation results
For different practical application scenarios, we demonstrate two types of numerical simulation that simultaneously carry out edge detection and imaging. Edge detection in a sparse scene with a large field of view, e.g., airplanes in the sky, ships in the sea. To simulate this scenario, we use a white background (the pixel value is 1) as the large field of view environment, and the aircraft (the pixel value is 0) as the target object in the scene [see Fig. 2 Original image]. The original image size is 128 × 128 pixels. With M=230-270 random binary speckle patterns the JIGI results are shown in Fig. 2, and the SNRs and PSNRs values of the reconstructed images are listed below the corresponding results. With definition in Eq. (15) and PLIR, the simultaneous acquisition of whole image [ Fig. 2(a)-(e)] and global edge [ Fig. 2(f)-(j)] information is realized. With M=230, the blurry image of aircraft is obtained in Fig. 2(a). However, the corresponding edge image is clearer [as shown in Fig. 2(f)]. The PSNR of edge image is higher than that of whole image 2.8891 dB. When the number of measurements is increased to 260, the edge and image quality are greatly improved. The SNR and PSNR of the edge are increased to 13.2407 and 21.1543 dB. And the PSNR of the image is increased to 18.3843 dB. Excitedly, with M=270, the results converged to the original image are obtained by joint iteration of PLIR and guided filter [see Fig. 2 (e) and (j)]. Edge detection in complex scene with gray scale. The application of edge detection based on JIGI is not only to binary objects, but also to gray scale objects. For the actual application scene, the edge detection of unknown target are more gray scale objects. First of all, a simple gray scale image is treated as the target object which is commonly used for edge detection, as shown in Fig. 3 Original image. As can be seen from Fig. 3, the edge and image information of the simple gray scale objects are effectively acquired, and the SNR and PSNR of the edge are increased to 13.1372 and 21.7232 dB. Similar to the phenomenon in Fig. 2 (e) and (j), when the measurement number is 170, the obtained results converge infinitely to the original image, as shown in Fig. 3 (e) and (j). The results in Fig. 3 show that GEGI method can still obtain high quality reconstruction results for simple gray scale object at lower measurement times. To further illustrate the effectiveness of JIGI, a gray scale image with more gray levels and higher edge complexity is used and the results are shown in Fig. 4. The same with the previous simulation results is that when the measurement times of this complex gray scale object is 780, JIGI can still get the reconstruction results which almost identical to the original image, as shown in Fig. 4 (e) and (j). Due to the multiple gray scale and edge complexity, the measurement times of convergence are higher than those in Fig. 2 (M=270) and Fig. 3 (M=170). To demonstrate the feasibility of this JIGI scheme, the actual experiment is conducted. The experiment system configuration is illustrated in Fig. 5, which includes a camera lens, a DMD, a reflecting mirror, a collecting lens and a photomultiplier tube (PMT). The applied DMD is an excellent device in the scheme for pixel multiplexed modulation and consists of 1024 × 768 micromirrors, each of which can be switched between two directions of ±12 • , corresponding to 1 and 0. The DMD displayed a preloaded sequence of random speckle patterns (128 pixel × 128 pixel) at rate of 1K patterns/s. Under ambient illumination (cold white LED), the target object is imaged onto the DMD by the camera lens. A current output type Hamamatsu H10721-01 PMT is placed on one of the reflection orientations to make the measurement of total light signal. The target object is an aircraft model (see Fig. 6 Object) with the size of 20 cm × 17 cm and positioned about 5m away from the DMD.

Experimental results
For comparison, CGI [8], GGI [27] and JIGI experiments are taken for the aircraft model. The imaging results of CGI are shown in Fig. 6(a). Since the GGI method needs to select the gradient vector of +45 • and −45 • for edge detection, the measurement times of PMT detector to obtain global edge image [as shown in Fig. 6(b)] is triple the number of the CGI random patterns (total M × 3 measurements). According to the experimental results in Fig. 6(b), GGI's edge detection quality is poor, and the effective edge information can be obtained hardly. However, by using JIGI algorithm, we can acquire a satisfactory image quality, as shown in the illustration of Fig. 6 (c)-(d). Specifically, Fig. 6 (c)-(d) shows five reconstructed images of the aircraft model by using different numbers of patterns. We can see that better quality of reconstructed edge and images with the measurement times increasing. When the measurement times is 500, the imaging and edge detection results of JIGI are obviously better than CGI and GGI, and the edge shape of the aircraft can be roughly distinguished. When the measurement times increases to 1000, the edge information of the aircraft model can be clearly distinguished. As the number of measurements is further increased, the details of the reconstructed image gradually emerge. For example, the engines on both sides of the aircraft have been reconstructed by measuring 8000 times, and the edge and texture feature information is more abundant [as shown in Fig. 6(d) M=8000]. The results of JIGI experiments verify the feasibility of simultaneously carry out high quality edge detection and imaging.

Conclusion
In this paper, we have proposed and demonstrated a new edge detection method named joint iteration ghost imaging which uses joint iteration of projected Landweber iteration regularization and guided filtering to realize the high quality edge and whole image information acquisition at the same time. The numerical simulations and experiments show that our JIGI method is validated. Moreover, the proposed method could directly extract the high quality edges in any direction or any GI experimental scheme (e.g. CGI, pseudo-thermal GI, etc.), no matter whether the unknown object is binary or grayscale. We also have compared the performance of CGI and GGI by experiments. The results have showed that the measurement times could be dramatically reduce by using JIGI. As guided filter has the ability of image matting, image super-resolution and haze removal, we believe that edge detection based on JIGI will be valuable in many real applications such as remote sensing, security check and medical imaging [47,48].