Using a Webcam for planetary Imaging

Webcam? did you say webcam?

Yes indeed, webcams make good planetary imagers. Why, because, in order to image planets, it is necessary to acquire a vast number of frames, which can be stacked to improve image signal to noise ratio and average atmospheric turbulence. Of course, they will not perform as well as dedicated planetary cameras such as a DMK or “the imaging source” cameras but they cost next to nothing, don’t they? Webcams format generally is 640  by 480 pixels, which is adequate, as planets are small. Nevertheless, it is not possible to use them for astronomy “out of the box”. That is because, webcams usually have some internal image processing to generate smooth images so that the girl or whoever (but girls are better)  you are video chatting with on the internet does not look all grainy… So what can be done about it? Well, some amateurs astronomers have come up with a way to reprogram a few webcam models so that they produce raw, non debayered images. the most common Webcam model used in astronomy (and the one I use) is the Philips ToUcam 2. “RAW” modifying this webcam could not be easier: all you have to do is download a free software called WcRmac from here and follow the istructions. You’ll also have to purchase an adaptor to replace the camera lens and fit it into a standard 1 1/4 inch eyapiece holder. Quite a few softwares can be used to record AVI movies from the modified webcams. I personally use QCfocus, which I like, because I have complete control over all parameters, gain and exposure time. QCfocus is also free. Being out of scope of this article, it is also possible to modify webcams for long exposure deep sky imaging, which can be useful for budding astrophotographers. The subject is, however, well covered on quite a few sites on the internet.

Planetary Imaging Workflow

Usually, the webcam is mounted in place of an eyepiece on the telecope. The best thing to do is to center the targeted planet into the field of view with a short eyepiece, and then, swap it for the camera. A barlow lens can also be used to magnify the planet is seeing conditions are good. Upon replacing the eyepiece with the webcam, do push the gain up and use a slow shutter speed, in order to be able to see the unfocused planet on the screen. Gain and shutter speed are then changed as focus is adjusted. It is important to use a shutter speed low enough to “freeze” the turbulence, but without having to push the gains up as noise to signal ratio will increase to unacceptable levels. There are no fixed rules, and only experience will tell you what the best levels are. You are then ready to begin image acquisition. To have full resolution with a webcam, image frequency has to set to its lowest limit which is 5 images per second. The more individual frames you aquire the better, the limiting factor being the rotational speed of the planet being filmed. For example, on Jupiter, 2 minutes is the accepted maximum since the planet rotates a little under 9 hours. For mars, the films can be a bit longer.

Once you have acquired the AVIs, they will be in “raw” format” which requires to be “debayered” to begin processing. For debayering and color conversion, I use AVIraw free software, available here. The AVI can then be processed using IRIS, available here. Iris is a really powerful software, not only used to process planetary images, but also CCD deep sky images.

Webcam image processing using IRIS

In IRIS, after adjusting  settings such as working directory, selecting PIC format an so on, you need to “convert AVI” in the “file menu”. There, you will enter letters (R,G,B) for the 3 basic colors into which IRIS will separate your AVI. Ther is then 2 ways to proceed: use automatic processing, or use manual. manual processing is more tedious but yields better results (see example below). They are 2 automatic processing algorithm: Alignment and addition 1, and alignment and addition 2. the first one is used to register complex shapes such as saturn or gibbeous planets while the second is good for jupiter, or Mars at opposition. Alignment and addition 1 requires you to “draw” a square on the planet and select the number of pixel the algorithm has to look into to register the planet, while Alignement and addition 2 requires the user to draw a square around the planet and set a treshold to detect the planet edge using the command line word circle xx, with xx a value. Detailed tutorials on IRIS are available from Christian’s excellent site here.

Example: Automatic processing vs Manual

Looking at the following images, the one to the left was processed automatically using alignment and addition 2 while the one on the right was done manually.

jup210910-2a   jup210910-2p

The manually processed image shows more details that the automatic one while the input data is the same. Follow the command sequence to process the AVI manually:

>bestof g 898 Scan all green frames
>select g gb Order from best to worst
>bestof r898 Scan all redframes
>select r rb Order from best to worst
>bestof b 898 Scan all blue frames
>select b bb Order from best to worst
>load gb1 Load best green frame
>Circle 20 Draw a circle at treshold 20
>cregister gb gr 15 250 Register green threshold 15
> load rb1 Load best red frame
> cregister b rr 15 250 Register red threshold 15
> load bb1 Load best blue frame
> cregister bb br 20 250 Register blue threshold 20
>add_norm gr 250 Add 250 best green frames
>save s1 Save as s1
>add_norm rr 250 Add 250 best red frames
>save s2 Save as s2
>add_norm br 250 Add 250 best blue frames
>save s3 Save as s3
>load s1 Load green image
>wavelet x y 6 Apply wavelet filter
>load x6 Load layer x6
>add y6 Add y6 layer
> add y5 Add y5 layer
> add y4 Add y4 layer
> add y3 Add y3 layer
> add y3 Add y3 layer
> add y3 Add y3 layer
> add y2 Add y2 layer
> add y2 Add y5 layer
>save sw1 Save green as sw1
>load s2 Load s2 red
>… And do wavelet filter for red
>save sw2 Save red as sw2
>load s3 Load s3 blue
>… And do wavelet filter for blue
>save sw3 Save blue as sw3
>circle 3000 Draw a circle at treshold 3000
> cregister sw swr 3000 3 Register green, red and blue layers
>trichro swr2 swr1 swr3 Composite color image
>save jupiter Save final image

Without question even though it does take longer, manual processing is superior.

VN:F [1.9.7_1111]
Rating: 9.3/10 (6 votes cast)
VN:F [1.9.7_1111]
Rating: +3 (from 3 votes)
Webcam Planetary photography, 9.3 out of 10 based on 6 ratings