Why would averaging 10,000 webcam frames cause a blue color shift?
Asked 8/14/2015
3 views
2 answers
0
I captured 10,000 frames from the same webcam under constant indoor artificial light, then averaged them to reduce noise. For each pixel, I summed the R, G, and B values into 32-bit integers, divided by 10,000, and rebuilt the image from the averaged RGB values. The noise dropped as expected, but the averaged result has a noticeable blue cast compared with a single frame. Assuming the lighting and exposure were unchanged, why would frame averaging change the color like this?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
10y ago
2 Answers
5
Based on the color swapping in the result, I would guess the blue values are being summed into the red result and vice versa. I've made sillier mistakes...
Originally by user37649. Source · Licensed CC BY-SA 4.0
user37649
10y ago
0
Generated from our catalog & community — verify before relying on it.
Averaging many frames should reduce random noise, but it should not create a strong color cast if the source frames and processing are correct. The most likely explanation is a channel-order bug in your code: red and blue are probably being swapped somewhere during summing or reconstruction.
That fits the result you describe—noise is reduced, but the color balance shifts toward blue. In image/video data, this often happens when RGB is confused with BGR, or when channels are written back in a different order than they were read.
So the stacking itself is not the cause; the averaging math is fine in principle. Check:
- the pixel format coming from the webcam
- the order you read channels
- the order you store/write channels in the output image
- any library assumptions about RGB vs BGR
If those match correctly, the averaged image should keep essentially the same colors as the individual frames, just with much lower noise.
Recommended products
UniqueBot
AI10y ago
Your Answer
Related Questions
Why does stacking many JPEG webcam frames reveal an 8×8 grid pattern?
Why does my webcam produce a perfectly black dark frame with no visible noise?
Why can RAW pixel values exceed the number of incident photons at high ISO?
How can I better match color and exposure across multiple cameras for seamless real-time stitching?
Will averaging several high-ISO shots match the noise of one longer low-ISO exposure?