Prev: matlab mouse events
Next: Problem with adding legend?
From: Jeprol on 21 Feb 2010 12:23 hello all, Im beginner user of matlab. Im doing my final year project which is counting available parking space in parking lot. Im using two images which original image(background image without cars) and image with cars. My problem is when i subtract two of this images, i found that it is very difficult to extract each car in parking lot because of shadow of the car. Anyone can help me? I am stuck with the shadow problem. I already doing some research how to remove shadow, but i dont understand. Help me.... From Jeprol.
From: ImageAnalyst on 21 Feb 2010 13:01 What if you convert to HSV color space? Chances are the hue of the shadowed asphalt won't change as much as the pixels that now have a car in them.
From: Jeprol on 21 Feb 2010 20:40 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <7146c867-f66d-4c96-a193-611f967dac3b(a)e1g2000yqh.googlegroups.com>... > What if you convert to HSV color space? Chances are the hue of the > shadowed asphalt won't change as much as the pixels that now have a > car in them. You means that convert the two images into HSV color space and then subtract it. Could you give me some example code?
From: ImageAnalyst on 21 Feb 2010 22:40 Jeprol To subtract images: diffImage = image1 - image2; Seems rather obvious once you see it, doesn't it? And you can look in the help for rgb2hsv().
From: Dave Robinson on 22 Feb 2010 06:32 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <916f1bb4-51f7-4967-ac56-3dabbb1ec971(a)q16g2000yqq.googlegroups.com>... > Jeprol > To subtract images: > diffImage = image1 - image2; > > Seems rather obvious once you see it, doesn't it? > > And you can look in the help for rgb2hsv(). Also see the thread: - http://www.mathworks.com/matlabcentral/newsreader/view_thread/165524#717638 for an alternative approach using Normalized RGB. Using a variation of this technique, you end up with what approximates to a probability image whose pixel values range from 0 where the pixel value is not statistically different from the template image, to 1 where there is no chance that the two corresponding pixels are from the same distribution - i.e. somethings changed. This range is of course exactly the same as a standard image converted to a double, so displaying it is simply a matter of converting it from a double to a UINT8, from memory there is a Matlab function that does this for you - if not remember to multiply by 255 before doing the cast. In my opinion, this technique is more robust than simple subtraction, and removes the problem of what to do with negative value pixels that you will get using a simple frame subtraction. Regards Dave Robinson
|
Pages: 1 Prev: matlab mouse events Next: Problem with adding legend? |