Tuesday, 27 February 2018

The Moon with a Sweex Viewplus WC070 webcam testing with AstroDMx Capture for Linux

A Sweex Viewplus WC070 webcam was placed at the Newtonian focus of an f/5 Sky-Watcher 130PDS Newtonian.

Sweex Viewplus WC070 webcam
Remounted WC070 webcams
The camera on the left is mounted in a project box and that on the right is in its original case with a C/CS ring glued to the front of the case.

AstroDMx Capture for Linux was used to capture 1000 tiff files at 1600 x 1200 resolution with real-time flatfield correction, using flatfield captured earlier, on a laptop running Debian Linux with the XFCE desktop environment. The capture was set to mapping YUYV to greyscale to avoid the chrominance, pixel vignetting problems with this camera. The images were registered and stacked in Autostakkert! 3 running in wine and the resulting stacked image was wavelet processed in Registax 5.1 also running in Wine. The final image was processed and re-scaled in the Gimp 2.9.
Clicking on an image will give a closer view.
Screenshot showing AstroDMx Capture for Linux capturing data. Note the histogram showing details of the exposure
The movable capture dialogue has been moved to show the histogram

Animation of alternation between applying realtime flatfield application and not applying it
The realtime flatfield correction can be seen clearly in this animation

Chrominance problems with the pixel vignetting make it more difficult to correct if YUYV mode is used. However, mapping YUYV to greyscale is prefectly satisfactory for lunar imaging.

Images produced by the above system

As long as flatfield correction is used, this low cost webcam produces images with very little compression, and is a good starter lunar imaging camera. At the time of writing, the WC070 camera can be purchased on Amazon for about GBP 15. More experiments will be done at a later date using the camera as a planetary imager.

Tuesday, 13 February 2018

Astrocrop for Linux final testing

Nicola has compiled deb and rpm install files for Astrocrop for Linux, a native Linux rendering of her Windows software. She will shortly be releasing the Linux version.
A static tripod mounted Panasonic Lumix DMC-FZ72 bridge camera at 60x optical zoom, fitted with a Baader solar filter, was used to image the Sun. The camera was set to burst mode, ISO-100 and 1/500s exposure at f/5.9. Images were captured in bursts of three. 104 images were precisely cropped and registered in Nicola Mackin's AstroCrop for Linux running on a Debian Linux laptop, stacked in lxnstack, wavelet processed in Registax 5.1 running in Wine and post-processed in the Gimp 2.9.
Click on the image to get a closer view.

AR2699 is clearly visible.

Wednesday, 7 February 2018

Testing the Sweex WC035V2 webcam as a starter imaging device

Sweex WC035V2 webcam only has a VGA resolution and costs, at the time of writing, less than £8 on Amazon. The camera is very easy to modify for attachment to a telescope using a standard webcam Mogg adapter. It has a number of controls that make it potentially suitable as a lunar imager: Exposure, gamma, brightness, contrast and white balance.
The silver coloured focusing ring can be popped out with the aid of a screwdriver or blade.

The lens can then be unscrewed from its 12mm thread holder
The IR cut filter is mounted on the lens rather than in front of the sensor.

A standard webcam adapter simply screws into place.

The bottom clip intended for holding the webcam on a computer screen can be removed by removing the single screw that holds it to the camera body.

The camera was fitted with a UV/IR cut filter and was placed at the Newtonian focus of an f/5, 130mm Newtonian and AstroDMx Capture for Linux was used to capture 1500 frames of each of three overlapping regions of the lunar terminator. The camera exhibits very little pixel vignetting and gives pleasant live views of the Moon making it suitable for use as an electronic eyepiece and for outreach.

Screenshot of AstroDMx Capture for Linux capturing with the Sweex WC035V2 webcam

The frames were stacked and flat-field corrected in lxnstack, wavelet processed in Registax 5.1 and the 3 panes were stitched together with Microsoft ICE, both running in Wine and post processed in the Gimp 2.9.

The camera does show some compression, but not as badly as in many cheap webcams. As a beginner's solar system camera it would be a suitable starting point.

Tuesday, 6 February 2018

Sample code to capture .bmp images from the Raspberry Pi Module

Here is a short sample Python 3 program to control a Raspberry Pi camera module and capture a specified number of named .bmp images to a folder. It also allows the camera to be set to capture mono or colour images.
It makes use of the PiCamera Class which provides a pure Python interface to the Raspberry Pi camera modules.

The program (Could be saved as 'Capture.py' for exmple.)

# Pi Camera Capture Demo Program
# by Steve Wainwright
import picamera
camera = picamera.PiCamera()
camera.resolution = (800, 600)
count = 30
num = 0
# Start preview overlay top left of screen, of size 800 x 600
camera.start_preview(alpha=255,fullscreen=False, window=(0, 0,800, 600))
# Bring the output below the overlay by printing empty lines
while i < count:
    print ("")
print (" ")
print ("Commands MENU")
print ("mono = Unsaturated images")
print ("col = Colour images")
print ("cap = capture images")
print ("q = quit")
while True:
    command = input('Enter a command: ')
    if command == "mono":
    elif command == "col":
    elif command == "cap":
        print ("Enter filename")
        fnam = input()
        print ("Enter number of images to be captured for  ",fnam)
        picno = input()
        picno = int(picno)
        print ("Capturing   ", fnam)
        for i in range(picno):
            # The path for saving must be set something like the next line
            # where images are saved to a folder on the desktop called PiImage
            camera.capture('/home/steve/Desktop/PiImage/%s_%s.bmp' % (fnam, num))
            num = num + 1
# Close camera and quit
    elif command == "q":

When loaded into IDLE 3 or the Thonny IDE, The code should look like this:

The program can be run from this IDLE 3 window by clicking Run and selecting Run Module as below:

Or from Thonny, the program can be run by clicking on the standard Run icon.
This will open the Python Shell and run the program.

Documentation for PiCamera can be found HERE.

Sunday, 4 February 2018

Flat-field correction of Pixel vignetting in CMOS webcams

A similar experiment was performed to the one with the Pi Camera in the previous post, imaging distant buildings across the valley to obtain test data. Two CMOS webcams were used: the Sweex ViewPlus WC070 and the Logitech HD C525. Both of these cameras were placed in turn at the Newtonian focus of an f/5, 130mm Newtonian. The data were captured with AstroDMx Capture for Linux.Stacking was done with lxnstack.
Both cameras showed Pixel vignetting when attached to the scope. However, unlike the Raspberry Pi camera module, the vignetting was not a reverse vignetting, as can be seen in the two flat-fields made by stacking 50 flat-field frames.
Sweex camera
Sweex colour flatfield

Sweex mono flatfield obtained by mapping YUV to greyscale
It can be seen that the vignetting is classical in that the centre of the image is bright whilst the outer regions are darker; unlike the Raspberry Pi camera module which showed reversed vignetting.

Uncorrected colour image (stack of 50 frames)

Corrected colour image

Uncorrected monochrome image

Corrected monochrome image

Logitech camera
Logitech colour flatfield

Uncorrected image

Corrected image

Tests of lunar and planetary images will be carried out when data can be collected. Meanwhile, simple flat-field correction looks very promising for the use of these CMOS, HD web cameras with small sensors, as solar system imagers.
The difference between the nature of the vignetting produced by a Raspberry Pi camera module and a different webcam such as the Sweex and Logitech devices tested here, when placed at the focus of a telescope is interesting. It can be speculated that in addition to microlens displacement, the Pi camera module has a processing correction in firmware. Either way, the flat-field correction makes these cameras usable for Lunar imaging, and possibly planetary and solar imaging.
AstroDMx Capture for Linux has real-time flat-field correction, which makes viewing and outreach use of these cameras a possibility.

Friday, 2 February 2018

Flatfields correcting luminance and chrominance pixel vignetting issues with a Raspberry Pi camera mounted at the Newtonian focus of an f/5, 130mm Newtonian

A Raspberry Pi camera was mounted at the Newtonian focus of an f/5, 130mm Newtonian. The scope was focussed on a distant building across the valley. 50 bmp images were captured of part of the building and stacked in lxnstack on the Raspberry Pi-3 running Ubuntu MATE. The capture software was a Python program that I wrote for the purpose of testing the suitability of the Raspberry pi camera module for astronomical imaging.
Stacked, uncorrected image
 It can be seen that the built in Chief ray angle correction has produced reversed vignetting, but also unacceptable chrominance effects with red predominating in the outer regions of the image.

The scope was pointed at a region of uniform sky and 50 flat-frame images were captured. These images were stacked in lxnstack to produce a master flat-frame.
Master flat-frame
 The reversed vignetting and chrominance imbalance is very clear in the flat-frame

The image data were then stacked in lxnstack with flat-field  correction.

Flat-field corrected image
 It can be seen that the flat-field correction made a good job of correcting for the pixel vignetting in the Raspberry Pi camera module when placed at the focus of the telescope.
Animation showing the effects of Flat=field correction
The conclusion is that whilst it may be best to use unsaturated data when observing and imaging the Moon,  It should be possible to use flat-field corrected colour data for imaging the planets.

Tuesday, 30 January 2018

Raspberry Pi cameras for Lunar imaging

The raspberry Pi Zero camera module can be mounted in the Pi case. The lens is unscrewed and a Mogg adapter attached to the Pi case. This means that the Pi Zero is both computer and camera.

The Pi-computer-camera running Rasbian Linux was placed at the Newtonian focus of an f/5, 130mm Newtonian and a neutral density filter was attached to the adapter.

Python software was written to display and capture bmp images

Two overlapping sets of 50 bmp images were captured and then stacked, with flatfield correction in lxnstack. They were processed and combined into a 2 pane mosaic of the terminator.

In a separate experiment, a Raspberry Pi 3 running Ubuntu MATE Linux was used with a remounted camera module which was attached to the 130mm Newtonian and a neutral density filter was attached to the adapter.

Using the Python capture software, sets of 150 bmp images were captured of different regions of the Moon. The sets were aligned and stacked with flatfield correction using lxnstack.

Both Pi cameras suffer from Pixel vignetting and they have inbuilt chief ray angle correction. With the lenses intended for these cameras, the chief rays pass at right angles to the pixel in the middle of the sensor, but at more oblique angles and produce lower levels of illumination further away from the middle of the sensor. Moreover, there are chrominance as well as luminance effects at different places on the sensor. The inbuilt chief ray correction in the camera compensates for the expected pixel vignetting.  However, if the small lens is removed from the camera and  the sensor is placed at the focus of a telescope, there is no need for the inbuilt chief ray correction. But, the correction is still made.
The result of this inbuilt correction is that the centre of the image is dimmed slightly and the outer regions of the image are increased in brightness.
This problem is corrected by flatfield correction. Classical vignetting is corrected by flatfield correction. The auto-corrected pixel vignetting produces an effect opposite to classical vignetting as the two following images show.
Classical vignetting
The centre of a classically vignetted image is brighter than the edges of the image and this is what a flat field image would look like.

Flat field from an auto corrected pixel vignetted sensor of a Raspberry Pi camera
The centre of this flat field image is darker than the outer regions. This is opposite to classical vignetting.

Nevertheless, unsurprisingly, the flatfield can correct the telescopic images captured from the Pi cameras as shown by the following animation:
Alternating flatfield corrected and uncorrected images using the same data captured from the Raspberry Pi camera. Unsaturated images were captured in order to avoid the chrominance effects of the chief ray correction, making the camera effectively monochrome.

The problem of auto corrected pixel vignetting seems to be a problem of other webcams with very small, but high resolution sensors. Future experiments will involve using only luminance data and flatfields from these devices to see if they can be useful imagers.

Saturday, 6 January 2018

Histograms, AstroDMx Capture for Linux and The Orion Nebula

A ZWO ASI120MC camera was placed at the Newtonian focus of an f/5, Skywatcher Explorer 130 P-DS OTA Newtonian mounted on a Celestron AVX, EQ, GOTO mount. 100 x 15s exposures of the Orion nebula were captured with AstroDMx Capture Linux running on a Fedora laptop. 25 matching dark frames were also captured.

The imaging setup

The images were registered, stacked and dark frame corrected in lxnstack, a native Linux application. The final image was processed in the Gimp 2.9.
Nicola has now implemented histograms in the software, some of which can be seen in the live preview screenshots below.
Screenshot showing a linear, averaged RGB histogram

Screenshot showing a logarithmic, averaged RGB histogram

The histograms can also show computed luminance, R, G and B channels as well as the RGB channels together.
Final image of M42/43

Box-mounted Raspberry Pi camera module, a Skymax 127 and Tycho

A Waveshare 5Mp Raspberry Pi camera module with a OV5647 CMOS sensor was mounted in a project box and a connector was used to connect the short ribbon cable from the camera, to a 1m ribbon cable from the Raspberry Pi 3 running Ubunto MATE Linux.

Box-mounter PiCamera

The camera was placed at the prime focus of a Skymax 127 Maksutov mounted on an EQ mount.

Using Python 3 software that I have written to capture .bmp images, I captured 100 .bmp images at 1024 x 768 resolution, of the Tycho region of the Moon. The images were registered and stacked in the Linux application lxnstack. The resulting image was wavelet processed in Registax 6 running in Wine via Exagear, and post processed in the Gimp, all on the Raspberry Pi. The wavelet processing was the only part of the process that ran slowly.

The Tycho region