Edge detection algorithm based on quantum superposition principle and photons arrival probability

ABSTRACT


INTRODUCTION
The importance of edge detection was appreciated from the first days of image processing. It represents the process of finding abrupt and significant changes in the gray level image intensity, and can be used in a variety of computer vision applications (e.g. segmentation [1][2][3][4][5][6], depth map compression [7], medical imaging [8]). Due to its importance, a lot of research has discussed this subject [9][10][11][12][13][14] and different comparative studies have been carried out [15][16][17].
In the last decades, the so-called Quantum Image Processing (QIP) approach was presented and developed, which uses quantum-mechanics principles to overcome the restrictions of classical image processing methods. As will be described later, the basis of QIP lies in presenting the image information with a combination of all its states [18]. This framework was first proposed by Vlasov [19] as a method for recognizing orthogonal images using quantum information and later employed to find patterns in black and white images by Schutzhold in 2002 [20]. After that, a series of researches was conducted [21][22][23][24][25], which led to powerful image processing algorithms that present robustness against limitations of classical algorithms such as sensibility to noise, edge continuity and computational cost. Furthermore, quantum image representation has remained as the foundation of several other works such as the PhD thesis of Venegas-Andraca in 2005 [26] or the work by Latorre [27], who presented the pixel value of an image into a real ket of a Hilbert space. The objective of all these types of works is to develop algorithms that are faster and more efficient than any classical method in this field. In the literature, a large set of edge detection approaches has been published, ranging from the wellknown Sobel and Canny detectors to new methods based on information theory to generate edge images [28]. The majority of these algorithms present some sensibility to noise while also needing a binarization step. In this paper we propose an algorithm that uses quantum-mechanics properties to find edges in digital images gathered by a CCD camera, by taken into consideration the probability of photons arrival to the camera sensor. This new edge detection method is composed of two main steps: (i) image enhancement using quantum superposition law and (ii) edge detection using the probability of photons arrival.
The proposed algorithm avoids the binarization step in order to both minimize the detection cost and avoid the set up of a binarization threshold, which can be difficult to find in some applications. Not only that, the found edges present a higher performance score (using the standard Fram & Deutsh metric presented in [29]) than classical methods like Sobel, Canny Kayyali or Singh [28], for noisy images, hence revealing its potential as an alternative method for such approaches. This is supported by a series of experiments carried out on synthetic images affected by different levels and types of noise. Finally, our approach has also been employed for image segmentation in real images recorded in greenhouses, as a first step to estimate the path of a mobile robot. The paper is organized as follows: Section 2 reviews quantum information principle while the proposed edge detection method is detailed in Section 3. Section 4 presents the experimental results and Section 5 summarizes and provides some conclusions to the paper.

QUANTUM INFORMATION 2.1. Theorical background
In classical image processing theory, a gray image is represented by an NxM matrix of pixels, each one quantified with q bits that provide possible values (typically q=8 bits, yielding 256 possible values). Thus, each pixel is represented by two pieces of information: the pixel intensity and the pixel position in the image. In turn, in quantum information processing (QIP), a pixel is represented by a so-called quantum bit or qubit [30].
In information theory, a bit can be represented in two forms: "0" or "1", while a qubit can be a linear combination of its possible states [30], so that it represents the superposition of two states, denoted by | ⟩ and | ⟩, as follows: This expression can also be written in matrix form as: with: | ⟩ ( ) | ⟩ ( ) In this equation, | ⟩ represents the wave function and and β are the probability amplitudes of states | ⟩ and | ⟩, respectively, which satisfy that | | | | . The geometric representation of a qubit was proposed by Bloch in 1946 [31] and it is named the Bloch"s sphere as shown in Figure 1. In this representation, contrary to a classical bit that could only be at the north (state | ⟩) or the south (state | ⟩) of the sphere, a qubit can be represented by any point of the sphere. Thus, (1) can be rewritten as [30]: By generalizing (1) for a system of n particles with n subsystems so that: | ⟩ | ⟩ | ⟩ represents the state of the particle, we have: where is an n-bits binary number, and the probability of the state so that:

Qubit Pixel
In quantum theory, a qubit pixel is the representation of the classical pixel including all its possible states. Thus, let I(x,y) be the gray level value of the (x,y) pixel of the normalized image I(m,n). The qubit pixel is then defined by: where √ ) √ ) are the probability for the pixel at (x,y) to be in the state "0" and "1", respectively. These two probability amplitudes must satisfy the condition: |√ ) | |√ ) |

THE PROPOSED METHOD
Once we have stated the basics of quantum information, in this section, we explain the two major steps of the proposed algorithm.

Quantum enhanced image
In order to isolate the object from the background, we employ (7) and the superposition law for n subsystems presented in (4) to go from a standard to a quantum pixel. For that, we consider the Moore neighborhood (with eight neighbors) of the active pixel as illustrated in Figure 2. This neighborhood can be divided into four subsystems with four different directions: Then, denoting the intensity of the pixel by , we apply (4) and (7) for each subsystem of 3 pixels, yielding states for each direction. Figure 3 hows an example of such states for the 0° direction, where "1" and "0" represent that the corresponding pixel belongs to the object or the background, respectively. This way, an object pixel can be considered to belong to an edge if, and only if at least one of its neighbors is a background pixel. Therefore, these two types of cases can be disregarded: Case 1: The active pixel is not an object pixel (state 0). Case 2: The active pixel is an object pixel (surrounded by object pixels in the given direction).
Considering these two impositions, we apply (5) to each subsystem, leading to: Similarly, we find that: Finally, the active pixel is replaced with the maximum value of the 4 directions.
being ) the new value of ) after the enhancement operation. This way, every pixel in the original image is processed according to its eight neighbors to generate the new quantum enhanced image as depicted in Figure 4.  based on the photoelectric effect [32]. On the other hand, the Plank-Einstein equation describes the energy E of a photon as: , with being the Planck constant , and the frequency in Hertz of the electromagnetic wave associated to the photon. Thus, the number of photons P that hit a CCD sensor during the time of exposition is related to the total energy received by the sensor E S through the expression: . This way, for an image, the mean number of photons per pixel is: Now, we assume that the number of photons arrived to a certain pixel is proportional to the gray-level intensity at that pixel, with a multiplying factor k, as: Applying the probability law on a given pixel and its Moore neighborhood, the probability of having ̅̅̅̅ photons in the pixel at (x,y) coordinates is as follows: In our proposed method, we give the value 1 to the pixels that have a probability higher than certain empirically found value.

EXPERIMENTAL RESULTS
In order to assess the performance of our proposal with respect to other algorithms, an objective and measurable criterion is needed. In this paper we will employ the Fram & Deutsh metrics as described in [29].

Method of evaluation
Fram & Deutsh proposed two parameters ( and ) to evaluate the behavior of edge detectors for normal and noisy images. These parameters range between 0 (random behavior) and 1 (good performance), and are applied in blocks divided into 3 regions as depicted in Figure 5, in where zones 1 and 2 are two blocks of pixels [29]. and (20) In these expressions, and are the number of columns and rows of the output binary image, respectively, while is the number of columns in the edge region. In turn, and represent the number of edge pixels detected inside and outside of the edge zone respectively. The value of is set to 30, as recommended by the original authors of the metrics.
On the other hand, characterizes the edge continuity and it is given by: where is the number of rows in the edge region that contain at least one detected point.

Experiments on synthetic images
Once defined the Fram and Deutsh criterion, we evaluate the performance of our proposal in comparison to three classical edge detection algorithms (Sobel, Kayyali [33], and Canny) and also to the method proposed by Singh [28], which starts with an image binarization using an optimized threshold and finishes by performing edge detection based on the Shannon entropy. In order to compare the results of these approaches, they were applied to two representative synthetic images devoted to edge detection and segmentation, which contain different types of edges: circular, vertical, horizontal and random. Besides, different kinds of noise were also added to them: Gaussian, Speckle, Salt and Pepper and Poisson.
As described in Section 3.1, the first step in our proposed method is performing image enhancement through the quantum superposition law. This has been applied to the above mentioned images, yielding the images in Figure 6, in where some regions have been zoomed in order to remark their details. The first image contains three different object forms: a big and a small square, a circle, and an amorphous object, presenting edges in different directions. Figures 7 and 8 show the results of applying the considered edge methods to the image when disturbed by speckle and salt and pepper noise, respectively.
As a quantitative assessment of the methods performance, Tables 1 and 2 presents and values for the first synthetic image in different cases: without noise, with Gaussian noise, Poisson noise, Salt and Pepper noise and Speckle noise. Similarly, the second considered image contains a wide range of different gray levels including textures, gradients and edges. The combination of texture and noise represents a suitable testbed to evaluate performance of the edge detection algorithm. Again, the results of applying the considered edge methods to this image when disturbed by speckle and salt and pepper noise are shown in Figure 9 and Figure      The presented results show a good performance of our proposal, outperforming the rest of considered methods in most of the situations. This way, by applying it to synthetic images, we can see that the proposed method successfully detects edges while preserving their continuity and object corners, even at the presence of different types of noise without the need of a post processing stage.

Real images application a. Controlled environment
In this stage, we apply our proposed method for the segmentation of the area of mint plant"s leaves as shown in Figure 11. After that, the centroid of the detected surface is calculated and transmitted to an agricultural robotised arm, placed on a mobile robot (with dimensions width=45cm, length=65 cm) [34], for pesticide and water application. Figure 12 shows the usage of the proposed method as the input of a Hough transform-based segmentation process [35] employed to estimate the robot"s trajectory (in green) between the pots"s rows (in red). Finally, in order to support the initial laboratory results, we applied the algorithm with real strawberry plant images to test its efficiency. The images were taken into a greenhouse at the ALLAL TAZI region of MOROCCO (GPS Coordinates 34°36"03.2"" N, 6°23"08.6"" W) by a Logitech HD Pro Webcam C920 [36] with resolution and 3.67 mm of focal length. Analogously to the in-lab tests, the method is used for the segmentation of the strawberry plant leaf area and the robot"s trajectory between greenhouse"s rows as shwon in Figure 13.

Discussion
Based on the results, we can clearly see that, after the enhancement stage as shown in Figure 6, the edges are emphasised in the image, hence paving the way of the algorithm"s second stage. In this second step, the proposed algorithm is capable of properly isolating the object from the background. The obtained values for the P 1 and P 2 metrics employed in this paper reveals superior performance in terms of edge quality than the classical edege detectors in computer vision literature. Not only that, our proposal is more efficient in terms of detection time and memory, as can be seen in Figure 14. Besides, the final result also shows a good performance for the new algorithm when dealing with different types of edges (circular, vertical, horizontal and amorphous edges) and with different types of object textures. It also shows a good behavior against noise, being especially robust against the apparition of isolated noisy pixels (e.g. Speckle and Salt and Pepper classical methods that detect such noise as edge points.

CONCLUSION
This paper has presented an edge detection algorithm based on the quantum superposition law and the photon arrival probability to a CCD sensor. The developed algorithm is able to detect edges with an optimal behavior against different types of noises while incurring in minimum computation time. A set of experiments has been presented to show the algorithm performance for different types of edges along with a comparison with three previous classical methods and the method proposed by Singh in 2008. This evaluation has shown a proper behavior against Speckle, Salt and Pepper, Poisson and Gaussian noises while keeping great edge continuity. Another benefit is its easy implementation, which reduces the algorithm computational cost.