# Vehicle detection in matlab [closed]

I am new to matlab and computer vision. I used the code given in the link to detect cars. But the problem is the shadow is also being detected and tracked. Can anyone tell me how to modify the code so that only car are detected. Link:http://in.mathworks.com/help/vision/examples/detecting-cars-using-gaussian-mixture-models.html Thanks in advance

• Welcome to DSP.SE! Please rephrase your question to ask about the algorithm you would use to fix the problem. THAT is a signal processing question. The way you have posed the question may belong more about code, which belongs on Stack Overflow. I'm voting to close until this is reworded. – Peter K. Mar 5 '15 at 22:45

In the example you've cited you feed RGB frames into vision.ForegroundDetector. To get rid of shadows you can try converting the frame into a color space that separates luma from chroma, using rgb2ycbcr or rgb2hsv. Then you can feed only the chroma components, cb and cr, or H and S respectively into vision.ForegroundDetector. The downside of this approach is that you will not be able to detect gray objects. So you will probably not detect wheels and windows of the cars, and you may lose the entire car if it is not colorful.