Design Article
Automotive vision system recognizes road signs: Part 3 - Implementation of a Sobel filter in C and assembler
Thorsten Lorenzen, Analog Devices
7/17/2008 10:57 PM EDT
Part 2 discusses software architecture and vision system design tips.
The demand for camera-based driver assistance systems in the automobile industry continues to grow. Traffic sign recognition is an application that is receiving much attention because of its potential for improving the safety of drivers and passengers. It is an example of the image recognition technology that can be applied to many areas of vehicular and industrial design.
Traffic sign recognition is based on pattern recognition algorithms that are well understood by machine vision specialists. The first two parts of this series detailed a camera-based traffic-sign recognition system implemented on the Blackfin® processor, a low-power and low-cost embedded DSP from Analog Devices. Those installments showed the design of an efficient software architecture and how a filter block algorithm can be used to implement the sign recognition application.
This part discusses how the Sobel edge-detection filter can be implemented in various ways by the use of a camera-aided traffic sign recognition system residing on a Blackfin processor. The results are then compared, and the steps that one can undertake in order to optimally use the available processing capacity are shown.
The Sobel filter
Usually the Sobel filter is located at the beginning of a processing chain. The computation results show the magnitude of the edges and their direction (vectors). This is done via a two-dimensional convolution. Figure 1 shows the operation of a classic convolution. In order to compute the value G22, for example, a 3 x 3 filter matrix H is placed over the input image F and each point of the matrix H is multiplied respectively with an image value and then accumulated. The 3 x 3 filter matrix H now roams over the entire image in order to also calculate value G from all the other image values. Equation 1 shows the operation of a convolution.


A two dimensional convolution consists of the sum of nine multiplications. For the Sobel filter, two convolutions per image value must be executedone for the edges in the horizontal direction Gx and one for the edges in the vertical direction Gy. The actual magnitude of the edge Gxy and the actual angle Theta can be derived from the results. In Figure 2 the Sobel operators are shown. Equation 2 and Equation 3 show the calculations from the implementation of the matrix values:



Since the Sobel operators have multiple zeros in the matrix, the number of multiplications can be reduced. Equation 2 and Equation 3 above show that only six accumulations are needed. Because the matrices of Sobel operators occupy some positions with the value 1, no multiplications need be done there. Only those positions having the value 2 must be considered. Alternatively, this can be realized with a very efficient shift by 1 to the left. The magnitude of each edge is calculated via the geometric addition of the values Gx and Gy. The result vector indicates this by its length as follows:

The angle of the vector can be calculated as well:





kyawgyi
8/30/2008 2:31 AM EDT
Hello,
I would like to know about
int i;
short a,b,c;
a=(nlineCount)/4;
b=(nlineCount+1)/4;
c=(nlineCount+2)/4;
for(i=0;i<192;i++){gxy[i*2+1]=uiInputLines[c][i+2]
-uiInputLines[c][i]
-uiInputLines[b][i]*2)+uiInputLines[c][i+2]-
-uiInputLines[c][i]+uiInputLines[b][i+2]*2);
{gxy}[i*2]=uiInputLines[c][i+2]
-uiInputLines[a][i]
-uiInputLines[c][i+1]*2)-uiInputLines[a][i+2]+
-uiInputLines[c][i]-uiInputLines[a][i+1]*2);}
's detail explaining.
Please help me
all of your paper to completely know.
Sign in to Reply