Video and Image Processing Blockset 2.8
Traffic Warning Sign Recognition
This demo uses the Video and Image Processing Blockset™ to recognize traffic warning signs, such as Stop, Do Not Enter, and Yield, in a color video sequence.
Watch the Traffic Warning Sign Recognition demo.
Contents
Demo Model
The following figure shows the Traffic Warning Sign Recognition model:
Traffic Warning Sign Templates
The demo uses two set of templates - one for detection and the other for recognition.
To save computation, the detection templates are low resolution, and the demo uses one detection template per sign. Also, because the red pixels are the distinguishing feature of the traffic warning signs, the demo uses these pixels in the detection step.
For the recognition step, accuracy is the highest priority. So, the demo uses three high resolution templates for each sign. Each of these templates shows the sign in a slightly different orientation. Also, because the white pixels are the key to recognizing each traffic warning sign, the demo uses these pixels in the recognition step.
The Detection Templates window shows the traffic warning sign detection templates.
The Recognition Templates window shows the traffic warning sign recognition templates.
The templates were generated using vipwarningsigns_templates.m and were stored in vipwarningsigns_templates.mat.
Detection
The demo analyzes each video frame in the YCbCr color space. By thresholding and performing morphological operations on the Cr channel, the demo extracts the portions of the video frame that contain blobs of red pixels. Using the Blob Analysis block, the demo finds the pixels and bounding box for each blob. The demo then compares the blob with each warning sign detection template. If a blob is similar to any of the traffic warning sign detection templates, it is a potential traffic warning sign.
Tracking and Recognition
The demo compares the bounding boxes of the potential traffic warning signs in the current video frame with those in the previous frame. Then the demo counts the number of appearances of each potential traffic warning sign.
If a potential sign is detected in 4 contiguous video frames, the demo compares it to the traffic warning sign recognition templates. If the potential traffic warning sign is similar enough to a traffic warning sign recognition template in 3 contiguous frames, the demo considers the potential traffic warning sign to be an actual traffic warning sign.
When the demo has recognized a sign, it continues to track it. However, to save computation, it no longer continues to recognize it.
Display
After a potential sign has been detected in 4 or more video frames, the demo uses the Draw Shape block to draw a yellow rectangle around it. When a sign has been recognized, the demo uses the Insert Text block to write the name of the sign on the video stream. The demo uses the term ?Tag? to indicate the order in which the sign is detected.
Traffic Warning Sign Recognition Results
Store