Behold, he renders the stars more starry
Jan. 26th, 2009 08:59 pmA two-step process here. The glare from the street-lights is fairly smooth whilst stars are fairly point-like, so in particular, if you take a square out of the image and line up the pixels in it by brightness, the middle one (the median) will almost certainly not correspond to a star, and will be probably a good estimate of how bright the street-light glare is for that square. So if for every pixel you consider the square around it, find that median brightness and subtract it, you've basically cut out the glare. Note from the image above that this treatment makes anything which isn't smooth glare with pointlike stars in it look Very Strange Indeed.
If you just apply the de-glaring process, the next problem is that bright stars look just the same size as faint stars; if you increase the overall brightness of the image so that the faint stars are visible, all stars above a certain brightness look like small white spots, and you can no longer see the constellations outlined by their brightest members.
To fix that, I've blurred the image, so that bright stars turn into large reasonably-bright blobs and faint stars vanish, and added the blurred version to the original to restore the faint stars. The result's pretty garish, but representative in three ways: bright stars are visibly prominent, the colours of the bright stars are about right, and (checking against an online star atlas) the faintest stars you can see in the image are pretty much the faintest stars that you could see with the naked eye were the town around Castle Hill to be replaced by unilluminated desert.
Here is the C++ code (requires libtiff, and I think I'm missing some important attribute so you have to do some no-effect transformation like mogrify -modulate 100 output.tiff to turn the TIFF file into one that the hugin panorama-making software can read).
Of course, once you have the data in a panorama program, there are various things you can do with it:
no subject
Date: 2009-01-26 11:00 pm (UTC)