Visar inlägg med etikett streaks. Visa alla inlägg
Visar inlägg med etikett streaks. Visa alla inlägg

söndag 27 november 2016

Removing hot pixels in a stacked image

Sometimes even an aggressive hot pixel filter won't remove all hot pixels. Here's a technique that can remove any residual hot pixels in a final stacked image. I use PixInsight's Morphological Transformation with a starmask to remove these nuisances.
Here's a crop of an image, showing what I'm talking about. The image was taken with a DSLR and consists of a stack of 10 sub frames exposed for 15 minutes each at ISO 800. My camera, a Pentax K20D, is getting old, and I always have lots of hot pixels in my images. Calibration removes most, but frequently a number remain after image integration. The technique which I describe here will dim the remaining pixels.
hot pixels after stacking
I start with making a Luminance copy of the image in its linear state, and apply STF to this grayscale image. Then I use the StarMask tool with a low value for Scale (typically 3 works ok) and a noise threshold of 0.5 (to be experimented with). I decrease large-scale, small-scale and compensation (1, 0, 1) and smoothness (about 6 - 8). Then apply the mask tool to the luminance copy. It may be necessary to tweak the parameters. No stars should be in the "Star-Mask" that is created.
When I'm satisfied, I apply the mask to the original colour image.
For pixel removal I use Morphological Transformation with Morphological Median as operator. Amount to about 0.5, iterations to 4 - 5, and Structuring Element to 9 pixels with a circular pattern.
Apply the tool to the image. If hot pixels of a certain colour remain, I split the RGB channels and use the channel that has the remaining hot pixels to repeat the process. The result is this.
Same crop after hot pixel removal
Further tweaking of the star mask and morphology parameters can improve this result even more, of course.

torsdag 21 juli 2016

The effect of dithering

Some time ago I wrote about how dithering can improve the quality of raw images.
If you control your camera and mount from a computer, you can use software to apply small mount movements between exposures. Some programs use random movements of the RA and DEC axes to avoid patterns in your stacked images.
Unfortunately, almost all camera control software is written for either Canon or Nikon cameras. Since I have an old Pentax camera, which has a quirky usb connector, I can't control it from my computer.
I've written about my ditherbox earlier. Here's an example of how it works.
This short video shows the effect of dithering. M45 was the target, and some 46 images were taken and registered. Before registering, the target is placed on different parts of the sensor according to the dithering pattern. After registering, the target is stationary, and the noise pattern moves against the dithering pattern. This is clearly seen in the video.


 
 
 
 

torsdag 7 juli 2016

Dithering in hardware

A common source of noise in astro images taken with a DSLR is hot pixels that were not removed in the calibration process.
When light frames are registered and integrated, and the tracking wasn't spot on, these hot pixels end up as streaks or "rain" in the final image.


Extreme crop of an unprocessed (but stretched) integrated image
Normally, a dark master frame is supposed to suppress hot pixels in the light frames before registration and integration. For a non cooled DSLR, it is very difficult to match the master dark to the light frames. Therefore, faulty pixels remain after the calibration process.
There are various processing tools that can be used on the raw image frames to remove hot pixels. These tools rely on filters that remove intensity values from either the individual frames, or from the stack of images that are to be integrated. By careful use of these tools, most of the noise can be reduced. The noise that remains in the final master image, can be further reduced during post processing.


Crop of the same area after processing
While the hot pixels can not be removed during data collection, the pattern they form after integration can be altered. The streaks in the first example were caused by tracking issues. If tracking had been spot on (e.g. through guiding), the hot pixels would not have formed a pattern, but be visible as bright points in the final integrated image.
If the camera is moved a few pixels in a random way, no streaks will form and the noise will not be visible. This technique is called dithering and was suggested by astrophotographer Tony Hallas.
Cameras are usually controlled by software running on a laptop, and many of these have the option to apply dithering.
However, most software is written for either Canon or Nikon cameras, and may not work with other brands. I use a Pentax K20D for all my astro work, and this camera has issues when trying to connect to a computer, so software controlled dithering is not possible for me.
The only way for me to use dithering was to sit next to the camera and manually move the camera in RA or DEC between exposures. Doing this during winter, trying to get 50+ exposures, was not my idea of a fun time.
The solution to this problem was to build my own hardware device for camera control; a ditherbox.

The device intercepts the trigger signal from the intervalometer and sends it on to the camera. In between exposures, it also tells the mount to move in either RA or DEC. It does nothing else. I have to figure out at what speed to move the mount (and program this into the handcontroller), and for how long. The box only sends a "move" signal for the whole time between exposures. This time is set in the intervalometer and is determined by the number of pixels to be moved, the pixel size, and the focal length of the lens or scope.
The heart of the ditherbox is a small microcontroller from Atmel, the ATtiny 84. All inputs and outputs are isolated through optocouplers, and it receives its power from the SynScan handcontroller. So there are no extra batteries or power cables involved.
More information on the device can be found on Stargazers Lounge. The software can be found on my Github site.
And here is an example of the benefits of dithering.
(NB: this image, while showing the same area of the sky, was taken with another focal length and under different conditions.)


Same area in the sky, imaged using dithering;
unprocessed (stretched) integrated image