Removing noise

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
lego
Posts: 9
Joined: 2010-04-13T03:43:09-07:00
Authentication code: 8675308

Removing noise

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Removing noise

Post 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.
snibgo's IM pages: im.snibgo.com
lego
Posts: 9
Joined: 2010-04-13T03:43:09-07:00
Authentication code: 8675308

Re: Removing noise

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Removing noise

Post 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
lego
Posts: 9
Joined: 2010-04-13T03:43:09-07:00
Authentication code: 8675308

Re: Removing noise

Post 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)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Removing noise

Post 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
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Removing noise

Post 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
lego
Posts: 9
Joined: 2010-04-13T03:43:09-07:00
Authentication code: 8675308

Re: Removing noise

Post 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.
Post Reply