US 5212740 A Abstract An edge detection apparatus and method for an image processing system are disclosed. The apparatus comprises a conversion means for converting input pixel data into tri-state valves, a matching means for obtaining inner products of tri-state valves and prespecified edge patterns and a decision means for determining the pixel data to be an edge when the pixel data is equal to the tri-state values. The edge detection apparatus can remove noise without an additional low pass filters, simplify the hardware and do real time process.
Claims(11) 1. An edge detection method comprising:
a converting step comprising steps for obtaining a mean value M _{i} of pixel data Z; in an n×n window and converting said pixel data in said n×n window into tri-state values V_{j} using said mean value M_{i} and a predetermined threshold value e ##EQU14## for j=1, 2 . . . , r; a comparing step for comparing V_{j}, which is said pixel data represented in tri-state values, with four pre-specified edge patterns W_{1}, W_{2}, W_{3} and W_{4}, where ##EQU15## where the superscript T represents the transpose of the matrix; and decision steps for determining said pixel data to be an edge if V_{j} is equal to any one of said four pre-specified edge patterns, and otherwise not to be an edge.2. An edge detection apparatus comprising:
conversion means comprising: a mean value calculation circuit for obtaining a mean value of pixel data in a 3×3 window centered by an input pixel of interest and a conversion circuit for B×B converting said pixel data into tri-state values using said mean value and a predetermined threshold value; matching means for obtaining inner products of said tri-state values and pre-specified edge patterns; and decision means for determining said pixel of interest to be an edge when said tri-state values are equal to any one of said edge patterns, and otherwise not to be an edge. 3. An edge detection apparatus claimed in claim 2, wherein said mean value calculating circuit comprises:
a first four-adder group for summing in pairs a first & second, third & fourth, sixth & seventh and eighth & ninth pixel data while excluding center pixel data; a second two-adder group for summing in pairs the outputs remaining after discarding a least significant bit from said first adder group; and a third adder for summing the outputs remaining after discarding a least significant bit from said second adder group and outputting the signal remaining after discarding the least significant bit. 4. An edge detection apparatus as claimed in claim 3, wherein said decision means comprises:
a set of four comparators for respectively inputting the output of four absolute circuits and a given threshold value; two OR gates for ORing in pairs the outputs of said set of four comparators; and an OR gate for ORing the outputs of said two OR gates. 5. An edge detection apparatus as claimed in claim 3 wherein said conversion means comprises:
a fourth adder for summing the output of said third adder and said predetermined threshold value; a fifth adder for summing the output of said third adder and a negative value of said predetermined threshold value; a first set of eight comparators for comparing the eight pixel data while excluding said center pixel data, with the output of said fourth adder; a second set of eight comparators for comparing said eight pixel data with the output of said fifth adder; eight inverters for inverting the respective outputs of said first set of eight comparators and outputting the most significant bit of said tri-state values; and eight OR gates for respectively ORing the outputs of said eight inverters with those of said second set of eight comparators, and outputting the least significant bit of said tri-state values. 6. An edge detection apparatus as claimed in claim 2, wherein said matching means comprises:
a first inner-product circuit for obtaining the inner product of said tri-state values and a first pre-specified edge pattern; a second inner-product circuit for obtaining the inner product of said tri-state values and a second pre-specified edge; a third inner-product circuit for obtaining the inner product of said tri-state values and a third pre-specified edge pattern; and a fourth inner-product circuit for obtaining the inner product of said tri-state values and a fourth pre-specified edge pattern. 7. An edge detection apparatus as claimed in claim 6, wherein said inner product of said tri-state values and said first pattern comprises:
three inverters for respectively inverting the most significant bit of the first, fourth and seventh values of said tri-state values; three AND gates for respectively producing the logical products of the outputs of said three inverters and the least significant bits of said first, fourth and seventh values of said tri-state values; a sixth five-adder group for summing the third, sixth and ninth values of said tri-state values and the outputs of said three AND gates by the use of sign extension; and an absolute circuit for obtaining the absolute value when the final output of said sixth adder group is negative. 8. An edge detection apparatus as claimed in claim 6, wherein said inner-product circuit of said tri-state values and said second pattern comprises:
three inverters for respectively inverting the most significant bit of the first, second and fourth values of said tri-state values; three AND gates for respectively producing the logical products of the outputs of said three inverters and the least significant bit of said first, second and third values of said tri-state values; a seventh five-adder group for summing the seventh, eighth and ninth values of said tri-state values and outputs of said three AND gates by the use of sign extension; and an absolute circuit for obtaining the absolute value when the final output of said seventh adder group is negative. 9. An edge detection apparatus as claimed in claim 6, wherein said inner product of said tri-state values and said third pattern comprises:
three inverters for respectively inverting the most significant bit of the first, second and fourth values of said tri-state values; three AND gates for respectively producing the logical products of the outputs of said three inverters and the least significant bit of said first, second and fourth values of said tri-state values; an eighth five-adder group for summing the sixth, eighth and ninth values of said tri-state values and the outputs of said three AND gates by the use of sign extension; and an absolute circuit for obtaining the absolute value when the final output of said eighth adder group is negative. 10. An edge detection apparatus as claimed in claim 6, wherein said inner product of said tri-state values and said fourth pattern comprises:
three inverters for respectively inverting the most significant bit of second, third and sixth values of said tri-state values; three AND gates for respectively producing the logical products of the outputs of said three inverters and the least significant bit of said second, third and sixth values of said tri-state values; a ninth five-adder group for summing the fourth, seventh and eighth values of said tri-state values and the outputs of said three AND gates by the use of sign extension; and an absolute circuit for obtaining the absolute value when the final output of said ninth adder group is negative. 11. An edge detection apparatus as claimed in any one of claims 7 or 8 or 9 or 10, wherein said absolute circuit comprises:
an OR gate for ORing the two least significant bits of four input bits; a first NAND gate for inputting the output of said OR gate and the most significant bit of said four input bits; a second NAND gate for inputting the most significant bit and the least significant bit of said four input four bits; a first XNOR gate for inputting the output from said first NAND gate and the second most significant bit of said four input bits; and a second XNOR gate for inputting the output of said second NAND gate and the second least significant bit of said four input bits, wherein the output of said first XNOR gate, the output of said second XNOR gate, and the least significant bit of said input data correspond to the most significant bit of said absolute value, the middle significant bit of said absolute value, and the least significant bit of said absolute value, respectively. Description The present invention relates to an image processing system and more particularly to an edge detection method and apparatus of an image processing system using multistate linear threshold logic elements. In a motion detection system, which is one of the most important application areas of the present invention, is preprocessing is recommended because it can improve the accuracy in detecting motion vectors by removing unwanted factors in the image such as noise. Preprocessing can also reduce the computational load by mapping a full resolution image, usually represented by 8 bits per pixel, to a different type image represented by less than 8 bits per pixel. Several kinds of preprocessing have been proposed for the above mentioned purpose. For example, Band Extract Representative Point (BERP) Method which was used by Umori et. al in "Automatic Image stabilizing system by Full-Digital Signal Processing", on IEEE Transactions on Consumer Electronics Vol. 36, No.3 published in Aug., 1990, can be thought of as a kind of bandpass filtering method. Although BERP method can efficiently filter out both the extremely high spatial frequency components such as noise and the low frequency components such as the flat area in intensity, it still needs more than two bits per pixel to represent the BERP image. The detected edge information can be represented by one bit per pixel. Accordingly, the edge detection method can simplify the hardware. There are various approaches for edge detection such as: (i) the use of image spatial gradients, (ii) the use of the Laplacian, (iii) the use of differences of averages, (iv) matching or fitting to a prespecified pattern, and (v) the detection of the zero-crossings filtered by the Laplacian of the Gaussian (LOG) in the image. The two major drawbacks of the edge detectors enumerated in (i)-(iv) are that they perform well only with some images and that performance of edge detection is prominently degraded when noise is present. On the other hand, approach (v) reduces the noise effect through the convolution with a Gaussian-shaped kernel. This operation may also improve the connectivity of extracted image and it guarantees that the zero crossings of the second derivative are preserved. However, the LOG operator has the potential drawback that the mask size is not constant and it becomes very large with a large amount of noise. Accordingly, it is an object of the present invention to provide an edge detection method which can reduce noise without increasing window size. It is another object of the present invention to provide an edge detection apparatus which can simplify an implementation of hardware and do a real time operation. To achieve the first object, an edge detection method of the present invention comprises the steps of; converting the pixel data into a set of multi-state values; performing an inner product of the set of multi-state values and a set of prespecified values; and making a decision according to the result of said inner product. To achieve the second object, an edge detection apparatus of the present invention comprises: a conversion means for converting the input pixel data into a set of multi-state values; a matching means for performing an inner product of the set of multi-state values and a set of prespecified values; and a decision means for making a decision according to the result of said inner product. FIG. 1 is a flow chart which shows the signal flow of an edge detection apparatus of an image processing system according to the present invention. FIG. 2 is a block diagram showing the edge detection apparatus according to the present invention. FIG. 3 is a block diagram showing a preferred embodiment of the edge detection apparatus according to the present invention. FIG. 4 is a block diagram showing the encoding circuit of the edge detection apparatus according to the present invention. FIG. 5 shows prespecified edge patterns used for the inner product of the present invention. FIG. 6A is a block diagram for the inner-product W FIG. 6B is a block diagram for the inner product W FIG. 6C is a block diagram for the inner product W FIG. 6D is a block diagram for the inner product W FIG. 7 is a truth table for the inner product output of W and V of the edge detection apparatus according to the present invention. FIG. 8 is a Karnaugh's map for the simplification of the inner product circuit of the edge detection apparatus according to the present invention. FIG. 9 shows a logic circuit diagram of the absolute value circuit of the matching means of the edge detection apparatus according to the present invention. FIG. 10 shows a logic circuit diagram of the decision circuit of the edge detection apparatus according to the present invention. FIG. 11 is a timing diagram for explaining the operation of the edge detection apparatus according to the present invention. The present invention is based on linear separability of multi-state linear threshold logic which can be explained by the following definition and theorem. Linear separability of binary input has been discussed in P. M. Lewis II and C. L. Coates, Threshold Logic, John Wiley and Sons, 1967. The definition of a linearly separable function of multi-state input is given here first. Let P be a set of L-dimensional vectors. Each component of any vector in P takes on of M=j+k+1 values in {-j, . . . , -1,0,1, . . . , k}, that is,
P={x|x Then the maximum number of different vectors in P becomes M Given the weight vector w, a logical function F defined by ##EQU1## where θ is a threshold value, is of the linearly separable class if and only if
W
and
YεP The analysis of multi-state linear separability is in general a complicated task. However, a special class of logical functions, which will be use in the proposed edge detector, can be shown to be linearly separable, according to the following theorem. Let x be an L-dimensional input vector whose components are all extreme values and let P P The proof of the above theorem is as follows. We prove this theorem, by using the above definition and showing that there exists a weight vector W which satisfies
W Let us consider the following weight vector ##EQU2## Then the following inequality holds
W By summing these inequalities for i=1, . . . ,L, we have
W because for at least one i, the equality should not hold. We can also consider a set P
W
YεP In order to use the multi-state linear threshold logic for edge detection, we have to map the continuous intensity value of a pixel to several discrete states. Let us use an 1×1 local window for detecting an edge at a given pixel location. We assume that the image size is n=n
Z
where
K=i+{ (j-1)/1 - 1/2 }n The notation 1/2 denotes the integer part of the resulting division, and i mod 1 equals the value of the residual of the division of the integer i by the integer 1. After the one dimensional array Z We define four pairs of bidirectional edges whose directions are 0 and 180, 90 and 270, 45 and 225, and 135 and 315 degrees, respectively. First, a right edge is defined by ascending input states from right to left in the local window. For 1=3, for example, the right edge and its bidirectional counterpart, the left edge, are respectively given by ##EQU5## where x represents the don't care state. The second pair of edges, the upper and the down edges are defined in the same way, that is ##EQU6## The third pair of edges denoted by right-upper and left-down edges are given by ##EQU7## Finally, the pair of edges denoted by left-upper and right-down edges are given by ##EQU8## For 1=5, the riHxt edge, for example, has 1 in the first column, -1 in the last column, and x (don't care) in the remaining columns. Using the multicategory discriminant function given in the equation both the right and left edges can be detected by the same weight vector, denoted by W
W Clearly, based on this equation, the rest of the weight vectors, that is, W.sub.|, W Alternatively, the LMS algorithm can also be used to obtain the weight vector. Based on the definition of edges given in the previous section, the edge is detected by ORing the outputs of four multi-state linear threshold logic with properly trained weight vectors. The complete edge detection procedure is described by the following algorithm. 1. Choose the size of the local window 1. 2. For i=1, . . . ,n do 2.1 Form Z 2.2 Compute the input state V set V 2.3 Compute the four inner products, W In implementing the above algorithm, the nonlinear function g(·) given as following is used, ##EQU9## where θ is a threshold value, θ was set equal to six when the above weight vector was used. Regarding the choice of the mask size, the following issues should be taken into account. The larger mask size, better the noise control due to the local averaging operation in step (2.2) in the above algorithm. However, there are two drawbacks in increasing the mask size, that is, (i) it becomes more difficult to detect edges in directions different form 0, 45, 90, 135, 180, 225, 270, and 315 degrees and (ii) since more inputs are needed for the multi-state linear threshold logic, more interconnections and computation are required. The mask size of 1=3 has been shown to be very effective based not only on window is the most sensitive one to edges in any direction, because it is the smallest symmetric window. FIG. 1 is a flow chart showing a signal flow in the edge detection method according to the present invention. By using FIG. 1, software implementation can directly be realized. In the first step, index i represents the lexicographically ordered pixel position. In the second step, get neighbors, Z FIG. 2 shows a general block diagram of an edge detection apparatus according to the present invention. The construction and function of the apparatus are as follows. FIG. 2 consists of three blocks, an encoding block for converting the lexicographical ordered data Z The above three blocks perform functions as follows. First, a concept of window is needed to decide whether the original image data X If V A matching block outputs the degree of matching of the converted image data and four prespecified edge patterns respectively. That is, the matching block performs the inner product of the converted image data, V A real time process can be realized, which is based on the image processing system by performing the operation of the four inner products simultaneously. A decision block performs a function which compares an output value of the inner products, W FIG. 3 shows of the a preferred embodiment edge detection apparatus according to the present invention. The construction and the function of the apparatus are as follows. An encoding means comprises a first delay device 10 for outputting one horizontal scanned line delayed signal, a second delay device 20 which is serially connected to the first delay device 10, for outputting two horizontal scanned line delayed signal, a 3×3 window circuit 30 for storing nine pixel data in the 3×3 local window circuit, a mean calculation circuit 40 for getting a mean value of an eight pixel data except the center pixel in 3×3 local window, and a tri-state encoder 50 for separating the respective eight pixel data from three levels by using the mean value and the given value and converting the eight pixel data into codes corresponding to three levels. A matching means comprises the inner product circuits 60, 61, 62, 63 for performing inner product of the respective prespecified edge patterns, W A decision means comprises comparators 70, 71, 72, 73 for comparing the outputs of the respective inner product circuit 60, 61, 62, 63 with the given constant and outputting the matching signal, and OR gate for summing logically the outputs of the comparators 70, 71, 72, 73. FIG. 4 shows a preferred embodiment of the encoding means. The 3×3 window circuit 30 comprises three registers 90, 91, 92 respectively including a set of eight parallel connected D-type flip-flops and serially connected to an input terminal for inputting a sequentially scanned digital video signal represented by eight bits, and three registers 100, 101, 102 respectively including a set of eight parallel connected D-type flip-flops and serially connected to an output terminal of the first delay device 10, and three registers 110, 111, 112 respectively including a set of eight parallel connected D-type flip-flops and serially connected to the output terminal of the second delay device 20 for inputting the output signal of the second delay device 20. The 3×3 window circuit 120 comprises adders 121, 122, 123, 124 for adding by twos the output signals of the eight registers 90, 91, 92, 100, 102, 110, 111, 112, except the output signal of the one register 101, and adders 130, 131 for adding by twos the signals remaining after discarding the least significant bit LSB from output signals of the adders 121, 122, 123, 124, and an adder 140 for adding signals remaining after discarding on least significant bit LSB from output signals of the adders 130, 131 and for outputting a signal remaining after discarding one least significant bit LSB of its output signal. The output signals of the eight registers 90, 91, 92, 100, 102, 110, 111, 112 and the output signal of the adder 140 are temporarily stored in registers (not shown) for inputting in the following stage. That is, the mean calculation circuit 120 calculates a means value as follows. Let Z
A=Z Here, let E, F, G, and H be the remaining after discarding one LSB bit of the values A, B, C, D. Then, E, F, G, and H are represented by ##EQU10## And, let I and J be the outputs of the addition of E and F, and G and H, respectively, such as, ##EQU11## Here, let k and L be the remaining values after discarding LSB from I and J, respectively, then K, L are represented by ##EQU12## And, suppose that the value resulted from adding K and L and discarding one LSB bit of the resultant value is M. M is represented by ##EQU13## The obtained mean value M is not an exact one. But the difference between the exact mean value and the obtained mean value doesn't degrade the quality of a resulting edge because the obtained mean value is used for tri-state encoding of the following stage. And, the tri-state encoder circuit 150 comprises the adder 160 for adding the mean value M and a parameter ε having a noise reduction effect and for producing a value M+ε; the adder 161 for adding the mean value M and the parameter-ε and for producing a value M-ε; a comparators 170 for comparing the respective pixel data, Z FIG. 5 shows the four prespecified edge patterns, W FIGS. 6A, 6B, 6C, 6D show the circuits for performing the inner products of the matching means of the present invention. The matching means performs the inner products between two's complement of elements of the respective four prespecified edge patterns, W FIG. 7 shows a truth table for the inner product. FIG. 8 shows a Karnaugh's map for the simplification of the inner product circuit. The simplified logic equations from FIG. 8 are
V
V These logic equation can be further simplified by using the properties of the four prespecified edge patterns. First, in case that W
U
U Second, in case that W
U That is, the inner product output is always "0" regardless of the image data and then doesn't have influence on the resulting edge. Third, in case that W
W
U As a result, in implementing a hardware, the four prespecified edge patterns exist implicitly, and only tri-state values look like having an influence on the output of the inner product. Also, the obtained inner product outputs are represented by two bits and only six pixels out of nine pixels are used for each matching with a corresponding prespecified edge patterns. A hardware implementation using the above logic equations is as follows. First, the matching circuit of W Second, the matching circuit of W Third, the matching circuit of W Fourth, the matching circuit of W These logic equations are implemented by using an inverters 200 and a AND gates 210 as shown in FIGS. 6A, 6B, 6C and 6D. Next, the outputs of the AND gates 210 and the outputs of the inverters 200 in the corresponding matching circuits are added for inner product. Here, the addition is implemented by using adders 220 because the outputs of the AND gates 210 are represented by two's complement, and by adding an absolute circuit 230 to obtain the same edge result in case that the final value of the addition has a negative value. Also, the addition of the outputs of the AND gates 210 and the outputs of the inverters 200 use sign extension method. The absolute circuit 230 shown in FIGS. 6A, 6B, 6C and 6D for obtaining the absolute value is shown in FIG. 9 in more detail. In FIG. 9, suppose that an input data are A FIG. 10 shows a preferred embodiment of the decision means of the edge detection apparatus of the invention. The decision means consists of four comparators 190 input signals, OUT1, OUT2, OUT3, and OUT4 from the matching means and a threshold value "110" of an edge, and two OR gates 300 for ORing the first two output signals of the four comparators 290, and OR gates 300 for ORing the other two output signal of the two OR gates 300. And, if at least one among the output signals, OUT1, OUT2, OUT3 and OUT4 is larger than or equal to "6", the output of the OR gate 310 becomes "1", that is, an edge. FIG. 11 shows a timing diagram of the operation of the edge detection circuit. Suppose that the input image data 90, 91, 92, 100, 101, 102, 110, 111, and 112 shown in FIG. 11 are stored in the 3×3 window circuit 30. Here, ε is set equal to 10. And the tri-state values, V The edge detection apparatus according to the present invention has the following advantages. First, by using the present multi-state encoding method, it can greatly reduce noise effect without using additional lowpass filters. Second, it can greatly reduce noise effect with 3×3 neighboring pixels, which is the smallest number of pixels for a two dimensional symmetric local window. Third, by using several linear threshold logics at the same time it can utilize the rotation invariant properties of multi-layered linear threshold logics. Patent Citations
Referenced by
Classifications
Legal Events
Rotate |