top of page
Stop Sign Detection in Images 

After successfully detecting lanes in pictures, we realized that the same concepts we used with lane detection could be applied to detecting street signs. For our project's purpose, we decided to focus on detecting stop signs.

 

Unlike the lane detection, we did not use any color-based filtering to preprocess our image. Instead, we detected edges by using a Sobel operator. We were able to carry out edge detection without color-based filtering because of the stop sign's shape. The octagonal shape allowed us to identify the stop sign because of its higher concentration of edges/lines in one area. 

​

The steps we used to pre-process our image and develop our stop sign detector are outlined below.  

Step 1: Grayscale

For the first step of pre-processing the image, we converted the image from RGB to grayscale form. We also applied a Gaussian filter with a standard deviation of 3, a number we found through multiple trials and experimentation.

Step 2: Sobel Edge Detection

Our goal was to use a form of edge detection on the image to outline the stop sign, the part of the image we were trying to identify. We were able to use an edge detector because  the stop sign has very different features compared to the other objects in the image. 

 

To identify all the edges in the picture, we created a binary mask. To develop this mask, we found the gradient image and a threshold value. 

 

We found both the threshold value and the gradient image by calling MATLAB’s edge function as shown below: 

 

[~,threshold] = edge(I,'sobel');

 

Then, we adjusted the threshold value we found by multiplying it by a factor we chose, and we called the edge function again, but now with the adjusted threshold.

Step 3: Identifying Concentrated Areas 

To make the stop sign become an area of white space on the image, we used MATLAB’s function imdilate. This function takes all detected edges and thickens the lines.

 

After the edges were made larger, we used MATLAB’s function imfill. This function fills-in shapes that have continuous thick lines. 

Step 4: Filtering Stop Sign 

To filter out the extra noise that was connected to the stop sign, we used MATLAB’s function imclearborder. To suppress surrounding noise we called  imclearborder with a coefficient of 4.

Step 5: Filtering Out 

Miscellaneous Objects

To further filter out the irrelevant white areas that were not connected to the stop sign, we used MATLAB’s function bwareaopen


The function bwareaopen takes in a binary image, and then eliminates connected areas on the image that are smaller than a specified number of pixels. For our purpose, we made the function eliminate white areas that were smaller than 850 pixels. We found this number by experimenting, and we noticed that the stop sign was the only part of the image that had a size larger than 850 pixels.

Step 6: Identifying Stop Sign 

At this point of the process, the stop sign was the only part of the image left, thus, our pre-processing attempts were successful. All we had left was to use the pre-processed image to identify where the stop was on the original image. 

 

To do this, we used MATLAB’s functions imfindcircles and viscircles

 

When we initially called imfindcircles, we noticed that imfindcircles found multiple circles within the stop sign instead of detecting the sign as a whole. 

 

To make the imfindcircles function only identify the stop sign as a singular circular object, we applied a Gaussian filter, with a standard deviation of 100, to the pre-processed image which forces imfindcircles to recognize the stop as a continuous area. We decided on using a 100 as our standard deviation after a number of trials.

 

To actually draw the identified circle on the actual image, we used the viscircles function. The final result is shown on the left. 

Click to see our Citations or Future Work

© 2023 by Maggie Cooney, Jahnavi Amam, Aneet Parmar, Gabriella Rodriguez. Proudly created with Wix.com

bottom of page