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)
i=0
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:
    i=i+1
    print ("")
    continue
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":
        camera.saturation=-100
    elif command == "col":
        camera.saturation=0
    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":
        camera.close()
        break

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.