# how to recognize a zebra crossing from top view using opencv ??

ou can get all the details about the problem from this pdf document: www.shaastra.org/2013/media/events/70/Tab/422/Modern_Warfare_ps_v1.pdf

how to recognize a zebra crossing from top view using opencv ?? it is not a straight zebra crossing it has some twists and turns i have some ideas, 1. parallel line detection but the available techniques only works to find straight parallel not the ones that has curve in it. 2. template matching to match a template of back to back white and black stripes but it becomes tedious since i cant find any pattern matching techniques with scaling and rotation.

in fact a idea on any single part of the problem will be so helpful! it is driving me crazy someone please help!!!! any help is appreciated thanks in advance ....

edit retag close merge delete

Sort by ยป oldest newest most voted

There are 3 common methods for compute of zebra orientation in blockwise mode.

1-It is possible to determine the frequency and the zebra orientation using FFT transform. Considering this characteristics, an image is divided in blocks of small size (e.g., 32x32).

2-The most simple and very common method used for zebra orientation extraction is based on gradient computation. Initially, the horizontal and vertical gradient are computed at each pixel using for example the sobel operator, then the image are divided in small blocks of size WxW (e.g., size 32x32) and computed the angle by analyzing the block.You can average the zebra orientation by this method.

3-The other method for zebra orientation extraction is based on eigen values & eigen vectors .It is given by the eigenvector having the highest eigenvalue.

more

Detection of white strips on zebra crossing is much easier than detection of general object. It has no internal edges. And It clearly distinguished from its surrounding. I think simplest way for detection will be application of Canny for detection of edges. Then you can use findContours on result of edge detection in order to find all contours in image. As a last step filter all contour that do not resemble rectangular white strips.

more

if you want use the canny algorithm in the outdoor condition you will need to estimate the threshold1 & threshold2 for canny algorithm in different lighting condition by neural network(train process).

( 2012-12-27 04:18:22 -0500 )edit

There really huge amount of approaches for automatic threshold detection. I once saw a survey that mentioned ~300 different methods. Personally I don't really like neural networks because they are complicate, relativelly slow and require learning. My favorite method is: 1 - calculate gradients in X and Y directions (Sobel), 2 - calculate gradient magnitude in each pixel, 3 - set lower threshold to be average gradient, and higher threshold to be average + standard deviation.

( 2012-12-27 05:43:14 -0500 )edit

thank you @michael i have already done that but the problem is the stripes are not exactly rectangle it will be like oval white stripes on black background path any idea on that ie. how to find shapes that are slightly oval ?? see that pdf document for image of the crossing!!

( 2012-12-27 07:33:53 -0500 )edit

Extracting contours will never give you exact rectangle even for rectangular stripes. This is the world of natural images. So you should collect objects whose features are "acceptable". For example their average color is "acceptably" close to white. Or their area is "acceptably" close to expected area. Or the object covexity is "acceptable". Or proportions of minimum bounding rectangle are "acceptable". And so on. You would have to define what is "acceptable" according to real images that you may get in your application.

( 2012-12-27 08:19:12 -0500 )edit

Official site

GitHub

Wiki

Documentation