Figure 4.5: Design of Robert cross–gradient operators using SC
This operator is one of the earliest techniques attempts to use 2–D masks in order to obtain the gradient components gx and gy at every pixel position in an available image. It can be seen in Fig.4.4 the implementation of Robert across–gradient operator with two 2–D masks which are applied for each pixel location (x, y). And afterward, the magnitude of the gradient is approximated by summing absolute values [10], given as
M (x, y) ≈ |gx| + |gy | (4.2)
This equation shows that besides the addition, the absolute operator is applied in this design. The authors in [16] recently proposed the architecture of Robert operator in detecting edges as shown in
  1. Original image (b) Conventional approach (c) Stochastic approach
Figure 4.6: Simulation results of edge detection based on Robert accross operator using: (a) conventional approach and (b) stochastic computing
Fig.4.5. In this configuration, the gradient magnitude at each pixel sx,y is calculated as
sx,y = 512 .Poutx,y − 0.5. (4.3)
where Pinx,y , Pinx+1,y , Pinx,y+1 , Pinx+1,y+1 , are the unipolar representations of the scaled pixels (Pinx,y =
256 ) at the positions (x, y), (x + 1, y), (x, y + 1), (x + 1, y + 1), respectively, and Poutx,y
is the unipolar encoding of the gradient magnitude at pixel position (x, y). Consequently, the result
corresponding to each pixel will be obtained by counting the number of bit being logic 1 in the output bit sequence.
The simulation results of this operator is shown in Fig.4.6. In this implementation, Stochastic sequences of length 2048 bits( corresponding to the resolution of 13 bits in conventional approach ), and SNGs based on CA rule 30 are considered. In addition, the 16–state FSM will be used for the stochastic absolute function. Under such configuration, it can be seen that the stochastic approach give a result as well as the conventional one. Even though SC certainly needs more time to carry out this operator, following Table II in [14], it can save more hardware resouce than the traditional approach to achieve an expected result.

Prewitt operator

\label{prewitt-operator}
In this work, we equally propose using SC in edge detection on a more complicated filter, the Prewitt operator [10]. The implementation of this operator is illustrated in Fig.4.7. A 3 × 3 2–D mask which is
numbered from 1 to 9 will be applied to calculate the intensity change for each pixel at center position
(in red). The gradient magnitudes following two direction gx and gy are computed as
gx = (z7 + z8 + z9) − (z1 + z2 + z3), (4.4)
and
gy = (z3 + z6 + z9) − (z1 + z4 + z7). (4.5)
where zi is the value of pixel at location i in our defined mask as shown in Fig.4.7. Finally, equation (4.2) is used to compute the gradient magnitude for the pixel at location (x, y). Intutively, we would expect this approach to be more accurate than one obtained using Roberts operator.