First time here? Check out the FAQ!

Ask Your Question
1

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

asked Dec 26 '12

vijay gravatar image

updated Dec 26 '12

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 ....

Preview: (hide)

2 answers

Sort by » oldest newest most voted
1

answered Dec 27 '12

Michael Burdinov gravatar image

updated Dec 27 '12

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.

Preview: (hide)

Comments

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).

Mostafa Sataki gravatar imageMostafa Sataki (Dec 27 '12)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.

Michael Burdinov gravatar imageMichael Burdinov (Dec 27 '12)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!!

vijay gravatar imagevijay (Dec 27 '12)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.

Michael Burdinov gravatar imageMichael Burdinov (Dec 27 '12)edit
0

answered Dec 26 '12

updated Dec 26 '12

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.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Dec 26 '12

Seen: 3,602 times

Last updated: Dec 27 '12