pythonopencvcomputer-visiongoogle-street-view

Detecting street lamps from google street view with OpenCV


I am trying to use OpenCV to detect street lamps from Google Street View.

For now as sample I have 2000 positive images, but only 1200 are around the same ration, so I am using only this for training.

And another 2300 negative images.

Example of positive images: StreetLamp StreetLamp StreetLamp StreetLamp StreetLamp

I tried down sampling them to different sizes, and train them, but for now the detection is really poor, when I test it with images like this: Test image[6]

Depending on detectMultiScale argument I either get a lot of rectangles, including the lamps, or a few rectangles, but not including the actual lamps.

On training, I am modifying mostly height and width parameters, example of parameters: (200, 10) (150, 30), (120, 30). I tried changing also the algorithm from LBP to HAAR, but the results were similar.

  1. Do you think I need more then 1000 positive sample?

  2. Should I do any extra preprocessing before creating the vector file?

  3. Do you have any idea on what parameters I should change to make it working?

  4. Is it possible with OpenCV to detect with lamps in google street view images?


Solution

  • Change your samples to just the lamp with a small amount of sky around it (as I think that will help specificity rather than cropped lamp).

    If the lamp-post matters to you, after finding a lamp, make a secondary search to find the post attached to it (or if there is none). Look for a line emanating from your found lamp and trace it down to the ground. In most of these images (and I imagine most scenarios) there will only be one clear line (the post) coming from the light. You could use some form of color/ directional propagation to trace the post through its various curves and corners.