|
"Vivi " <vivisuriani@yahoo.com> wrote in message <ggvsmu$550$1@fred.mathworks.com>...
> I'm now working on my final project : Stereo Vision...
> I have a problem in removing noise, i have an image that i captured from a webcam and the object is a Square Box (black) and the background is white, but the image's background not totally white because there is some noise like people walking around, etc.
>
> after i have the picture, i use 'imread' function to read the image and then i use 'rgb2gray' then i binarization the image using Threshold=150.
> the image after binarization is not only show the Square Box (black) and the white background, but there are a lot of noise.
>
> here is the image :
>
> [IMG]http://img389.imageshack.us/img389/5668/gambarrusakey3.jpg[/IMG]
>
> my question is how to remove the noise?
> i cant change the threshold because i have another image that have a different light intensity.
Think in Fourier...
your box has a lot of low frequencies, while your noise is mainly high frequency. First, you could try to eliminate it by applying a low-pass filter to your image, before thresholding it (moving average, gaussian blurring, or whatever).
Then, after thresholding, you can use the morphological closing algorithm (check http://en.wikipedia.org/wiki/Closing_(morphology)) or the opening algorithm to either remove more noise, if the first one wasn't sufficient, or to fill the square, if you removed some points inside of it.
And then, if you really want to do a nice job, after thresholding and stuff, apply an edge detector to your image, and make a Hough transform of the resulting image. You'll have the equations of the edges of your square. Note that noise removal and thresholding is not strictly speaking necessary to make a Hough transform, but in your case I think it would help.
Et voil? ;)
Ask if something isn't clear!
Cheers,
Gavrilo
|