Archive for the ‘Coding Is Fun!’ Category

Blackhole Sun Won’t You… Go Away?

Sunday, September 12th, 2010

In coding my time lapse processing utility, SBG, I’ve seen a lot of strange artifacts created by code defects, unexpected results of otherwise good code, and everything in between.   So when I saw the sun showing up as a round black disk, I figured it was time to crack open the image stacking code again.    But after noodling around it occurred to me to look at the resulting stacked image a bit closer.

Note that the stacked image ( 10 images, averaged to yield the image above ) shows what appears to be motion blur on the “blackhole sun.”   If this were a math error in SBG’s stacking algorithm, caused by the summing of rgb( 255,255,255 ) in SBG’s 16-bit / channel workspace – e.g. a rounding error where the resulting pixels become rgb( 0,0,0 ) when converted back into 8-bit RBG – then the result would impact only the interior where multiple sun images overlap.   The problem would be limited to the intersection:

Instead, what we see is what we would expect if the original source stills had “blackhole suns” themselves, and SBG dutifully averaged them together!    So the camera itself is creating the blackhole sun effect.   Garbage in, garbage out.