After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584078 - Time-averaging filter for photos, to reduce Gaussian noise
Time-averaging filter for photos, to reduce Gaussian noise
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 584077 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-05-28 07:01 UTC by Mario Valdez
Modified: 2013-08-23 10:37 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Testcase: original single frame (27.24 KB, image/jpeg)
2009-05-28 07:07 UTC, Mario Valdez
Details
Testcase: averaged picture, made from 8 single photos (50.19 KB, image/jpeg)
2009-05-28 07:09 UTC, Mario Valdez
Details

Description Mario Valdez 2009-05-28 07:01:24 UTC
It would be nice to have the option so that Cheese would take several successive pictures, then calculate the average of them and save a single picture. This would eliminate most noise in the image. All webcams I have tested are very noisy indoors, even with good light conditions (well, "good" for the human eye, I guess). 

Cheese could take from 5 or more images in 0.05 seconds each or less, then just sum each pixel value and then take the average of it. That is an effective and very simple way to reduce the image noise.

Regards,

MV
Comment 1 Mario Valdez 2009-05-28 07:07:14 UTC
Created attachment 135476 [details]
Testcase: original single frame

This is a noisy single picture taken with Cheese
Comment 2 Mario Valdez 2009-05-28 07:09:49 UTC
Created attachment 135477 [details]
Testcase: averaged picture, made from 8 single photos

This is the average of 8 noisy pictures taken by Cheese. If you compare this file with the single noisy picture, you will see the difference in quality.
Comment 3 Filippo Argiolas 2009-05-28 07:41:26 UTC
IMHO this could work well for still subjects. Cheese is for shooting photos of faces and it's unlikely that a face will stay still for half a second. This could lead to photos with well defined backgrounds and blurry faces.
Anyway, what did you use to average the photos? I'd like to do some test.
Comment 4 Mario Valdez 2009-05-28 13:01:21 UTC
If you have ImageMagick installed:

convert -average source1.jpg source2.jpg source3.jpg... sourceN.jpg -quality 90 result.jpg

Of course the result would be better if you feed the source images in a lossless format. I have tested with 2 to 30 pictures and I think the greatest improvement happens with the first 5 to 10 pictures. After that it starts to get a bit blurry (I'm not sure if this is caused because of the vibration of my desk [most likely] or maybe the camera CCD is not that stable).

You can test with other programs but I think ImageMagick is the simplest and fastest (and it works from the command-line).

Regards,

MV
Comment 5 Filippo Argiolas 2009-05-28 13:13:02 UTC
As I thought, if I shoot several photos of myself (tried with 6 with a rate of 4 per second) and average them I get some big improvement in the background but my face it blurred because of those little movements I do with no control.
I'm not sure if this will bring any real gain, if I'd have to chose between the blurred face + perfect background and the noisy but well defined photo I'd surely chose the second one.
Comment 6 Mario Valdez 2009-05-28 13:36:55 UTC
And if you try with a fastest rate (like 6 images at 30 fps, 6 images in 200 ms)? I guess Gaussian noise changes quickly, so even images that close in time may work.

Maybe I'm trying to solve the wrong problem with Cheese. I've seen places where a webcam is used to take ID pictures (for ID cards, for example), I've seen people taking astronomy pictures with webcams, and I've seen home-made surveillance systems using webcams (for example, at front-desk offices). In all those examples they were using the software provided with the webcam, which usually is simpler than Cheese.

So I thought in those examples a less noisy image may be useful. Just my idea. 

If you think this will bloat Cheese maybe this should not be implemented.


Regards,

MV
Comment 7 daniel g. siegel 2010-08-09 00:36:59 UTC
*** Bug 584077 has been marked as a duplicate of this bug. ***
Comment 8 daniel g. siegel 2010-08-09 00:38:05 UTC
quote from #584077

> You should consider reopening/reassigning this bug to gstreamer.
> With a gstreamer SR filter would be pretty easy for us to support it.
Comment 9 Sebastian Dröge (slomo) 2010-08-09 07:14:55 UTC
Should be very easy to implement in GStreamer. I'll take a look at it later.

Do you guys only want a simple average or different weighted averages (e.g. gaussian or triangular averages with the middle having a higher weight than the borders. This might decrease the blurring if something moves a bit)
Comment 10 Filippo Argiolas 2010-08-09 08:01:52 UTC
Daniel, for the sake of completeness, I don't think bug #584077 really is a duplicate of this one. This is about noise reduction by averaging in time domain, that's about a upscaling images using several low res frames and a super resolution algorithm.
Comment 11 daniel g. siegel 2010-08-09 10:21:51 UTC
right, i misread that. however it goes into the same direction
Comment 12 Sebastian Dröge (slomo) 2013-08-23 10:37:38 UTC
Doesn't look like there's much demand for this or anybody wanting to implement this kind of filter although it would be very easy. Let's close this bug until someone actually wants to spend time on it, no point in keeping this open currently.