-1

To detect a car trailer its very hard. There're a lot of car trailers that has the same license plate as the car itself. To detect if its a trailer I need to search in a area around the license plate. I already making a detector for the license plate with Viola and Jones. Only to detect where the triangle is you don't see it very clearly on the image. The images coming from section control so a lot of different thresholds in the day time.

enter image description here For the privacy I have to delete the license plate details

So my question are there special ways of image processing that would be help full. I thought about:

- canny 
- adapting threshold 
- image Gradients

But big difficulty is that the application needs to be real-time.

Martijn van Wezel
  • 1,120
  • 14
  • 25
  • This is better fitted for dsp.stackexchange.com – James Mertz Mar 05 '15 at 15:28
  • Somehow the three phrases together: 'image processing', 'python' and 'real-time' don't sound right to me. – SF. Mar 05 '15 at 15:29
  • I cannot see anything on your example picture. Could you please describe what you are supposed to see? – MarcelSimon Mar 05 '15 at 15:29
  • @SF okay, I am a student that doing research for a company. When I come with a solution it has later on working in real time. So my application needs to be fast not taking 2 houres of working. – Martijn van Wezel Mar 05 '15 at 15:32
  • @MarcelSimon You see the light bar of a car trailer the 'bright' gray part is the part where the license plate is. the triangle are on the place where the lighting is. – Martijn van Wezel Mar 05 '15 at 15:33
  • @MartijnvanWezel: Well, you can (and should) develop a working solution for off-line images (Python is okay for that) and then work on improving performance to make it real-time, say, by porting it to a more efficient language. – SF. Mar 05 '15 at 15:34
  • 1
    I would start looking at these articles: http://www.pyimagesearch.com/2014/11/24/detecting-barcodes-images-python-opencv/ http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/?__s=gyev3nc3syxttrifwrs6 – James Mertz Mar 05 '15 at 15:35
  • @SF I can use later visual c++, Delphi etc. – Martijn van Wezel Mar 05 '15 at 15:36
  • Will the triangles be always on the same height as the license plate, and about the same distance from it? – SF. Mar 05 '15 at 15:38
  • @SF no not always but most of the time same high as the license plate and same distance to the middle of the license plate – Martijn van Wezel Mar 05 '15 at 15:39

1 Answers1

1

The way I see it, you will need edge-detection (canny) and image correlation (finding similar shapes; recognition of object in the image).

Your two basic shapes (patterns to seek) would consist of the line-image of license plate, the base line of the bumper, edges of the lights, and respectively the triangles for one and no triangles in the other. The presence and absence of the triangles should be the only difference between the two images to be sought.

First, you process the image through Canny or Sobel or some other edge-detect to get the edges. Then you correlate it with the two patterns. The correlation function should produce "quality of match" value - how well the shape found in the image matches the pattern. If the one with triangles matches better, it's the trailer.

Don't try to detect just the triangles. They are too dim to produce a decent match, and too common a shape, possibly producing countless false positives. Seek bumper with lights and license plate, and then once that is found, compare it to example bumper with triangles, and example bumper without triangles. That way no matter how poor the triangle detection, the match against the image with triangles will always be better if they are there.

SF.
  • 13,549
  • 14
  • 71
  • 107
  • what values I need to give in the input of canny? Because a lot of different thresholding I couldn't give a good one – Martijn van Wezel Mar 05 '15 at 15:57
  • @MartijnvanWezel: You'll need lots and lots of experimenting to get the right ones. Make sure that at least hints of the triangle edges show up. – SF. Mar 05 '15 at 16:02
  • how to detect the triangle then, because this approach I already tried. Its possible, but a lots of experimenting and I hope there was another solution with learning or anything else. – Martijn van Wezel Mar 05 '15 at 16:03
  • @MartijnvanWezel: First you need to make the image fit for seeking the shapes; you'll probably need Median or even some blurring to get rid of ISO noise, then detect the edges. Image correlation is a subject far too large to cover in an answer here; look up topics like [Image moment](http://en.wikipedia.org/wiki/Image_moment). Shape finding is even larger a domain. Probably there are libraries that aid this in Python, but I don't know them. – SF. Mar 05 '15 at 16:08