Saturday, October 28, 2017

image processing - How to extract traffic signs from a photograph?


What image analysis techniques can I use to extract the traffic signs from an image such as the one below?


Exterior shot of a metropolitan roadside


Edit:


After Anisotropic diffusion: The background that i don't want gets cleared a little


enter image description here


After Dilation :



enter image description here


Thresholding after Diffusion : Not able to figure out the best thresholding for this purpose


enter image description here


However i am not able to figure out how to remove the background?


Edit : i just want these parts of my image


enter image description here


Taking another input image :


enter image description here


Applying median filtering and edge detection :


enter image description here



After Bottom hat filtering:


enter image description here


How do i isolate the road signs please help?



Answer



Did you try something simple like correlation?


(EDIT). The idea behind correlation is to use a template (in your case a trained road sign sample), and compare it to every position in the test image. The comparison operation I've used to generate the images below is called normalized cross-correlation. Roughly speaking, you standardize (mean=0, standard deviation=1) the pixels in the template and the image part you want to match, multiply them pixel by pixel, and calculate the mean value of the products. This way you get a "match score", i.e. a measure of similarity between the template and the test image at every position in the test image. The position with the best match (highest correlation) is the most probably candidate for the position of the road sign. (Actually, I've used the Mathematica function CorrelationDistance to generate the image below, which is 1 - (normalized correlation). So the darkest spot in the match image corresponds to the best match).


I don't have any other templates, so I simple cropped the sign from the second picture you posted:


enter image description here


Even though the template is rotated slightly, cross correlation still looks usable


enter image description here



and the best match is found at the right position:


enter image description here


(You'd need multiple scaled versions of each template to detect signs at any size, of course)


No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...