Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to remove noise??

Subject: how to remove noise??

From: Vivi

Date: 1 Dec, 2008 05:29:02

Message: 1 of 4

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.

Subject: how to remove noise??

From: Vivi

Date: 1 Dec, 2008 05:35:02

Message: 2 of 4

this is the link for image, in case above is not working... ^^

http://img389.imageshack.us/img389/5668/gambarrusakey3.jpg

Subject: how to remove noise??

From: Gavrilo Bozovic

Date: 1 Dec, 2008 07:15:09

Message: 3 of 4

"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

Subject: how to remove noise??

From: ImageAnalyst

Date: 1 Dec, 2008 13:16:59

Message: 4 of 4

On Dec 1, 12:29=A0am, "Vivi " <vivisuri...@yahoo.com> wrote:
> 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 t=
hen i use 'rgb2gray' then i binarization the image using Threshold=3D150.
> 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 diff=
erent light intensity.

--------------------------------------------------------------------
Vivi:
Well there are several ways, depending on what you know or assume
about the objects.
1) Do you know the position? If so, just find its centroid or
bounding box (via bwlabel and regionprops) and get rid of all blobs
that don't match (or are very close to) the object you're trying to
find.
2) Do you know the perimeter? If so, get rid of all objects not
having that perimeter.
3) Do you know the shape? If so get rid of everything without that
shape. Shape can be circularity (perimeter squared divided by area)
or eccentricity.
4) If you don't know what distinguishes your object from everything
else, just look at all the measurements you can make with
regionprops. Then figure out which one or combination of them makes
up a feature vector that uniquely identifies your object.
Regards,
ImageAnalyst

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us