Page 1 of 1

Removing noise

Posted: 2010-04-13T03:52:18-07:00
by lego
Hi, I have a digital movie with a lot of noise, which appears as many colored pixels. The movie is a high-speed movie and has about 8000 frames, which I can extract, for example, by running "mplayer -vo jpeg movie.avi". I was wondering that maybe if I could separate the black parts from the rest of the colors for each frame, the noise would disappear as the noise is colored, but not black. I need to conserve the edges of the movie, so I can not blur the image, but with only black and white (with no grayscale) it would be ok (its for shape detection).

Is there any way to do that?

Re: Removing noise

Posted: 2010-04-13T07:52:36-07:00
by snibgo
"-adaptive-blur" might do the trick, or "-level" or a simple threshold. You might post a couple of adjacent frames, so we can see the noise and offer suggestions.

Re: Removing noise

Posted: 2010-04-13T09:00:42-07:00
by lego
Thank you for your reply.

I attach two consecutive frames (I uploaded it to tinypic because it's the only way I know to attach images in this forum), so you can see the noise:

Image

Image

I would like to catch the shape of the liquid as closely as possible, all the other things (colors, brithgness, etc) are useless for me.

Which do you think is the best method to catch the liquid shape?

Re: Removing noise

Posted: 2010-04-13T09:21:19-07:00
by fmw42
try my script, isonoise, at link below:

isonoise -r 2 -t 10 1zx8jrs.jpg 1zx8jrs_iso_r2_t10.jpg
Image


isonoise -r 2 -t 5 1zx8jrs.jpg 1zx8jrs_iso_r2_t5.jpg
Image

Re: Removing noise

Posted: 2010-04-13T09:49:27-07:00
by lego
It's very good in removing noise, thank you for your suggestion.
Do you know how can I catch the liquid shape? (with or without noise)

Re: Removing noise

Posted: 2010-04-13T10:03:51-07:00
by snibgo
The greatest difficulty seems to be separating the bottom drop from the background. Many possibilities exist, depending on what you want to do with the output images. For example:

Code: Select all

convert 1zx8jrs.jpg -colorspace gray -noise 2 -median 2 ( +clone -adaptive-blur 10x3 ) -compose difference -composite  -threshold 10% liquid.jpg
Image

Re: Removing noise

Posted: 2010-04-13T10:12:20-07:00
by fmw42
don't know if this is what you want.


convert 1zx8jrs_iso_r2_t5.jpg -channel g -separate -channel rgb -lat 25x25+10 1zx8jrs_iso_r2_t5_g_lat25x25+10.jpg
Image


convert 1zx8jrs_iso_r2_t5.jpg -channel g -separate -channel rgb -lat 50x50+10 1zx8jrs_iso_r2_t5_g_lat50x50+10.jpg
Image


convert 1zx8jrs_iso_r2_t5.jpg -channel g -separate -channel rgb -threshold 70% 1zx8jrs_iso_r2_t5_g_t70.jpg
Image

Re: Removing noise

Posted: 2010-04-13T14:17:43-07:00
by lego
Thank you so much!

You gave me some great ideas of convert options that I can use, I will be playing with -lat, -threshold, and separation of channels, together with the isonoise script by fmw42, until I found the best result for me. Probably I will try to change the contrast and/or brightness before applying this nosie-reduction and shape-detection, maybe this can improve a little bit the desired output.
Once I have found the best solution, I will write a little bash script to convert the 8000 frames.

Thank you very much for your help, which I needed because I am completely new to image manipulation.