First Light for Linux imaging application

It’s been a stupendous time coming thanks to the grim weather we’ve had over the last three months, but then if the weather hadn’t been grim I might not have got so far 😀

However, two nights ago I went out on a beautifully clear night and used the latest version of my imaging code to capture some images of Jupiter using the 127 Mak and ASI120MC. This was obviously quite a big deal because although I’ve managed to capture video before, up until now I had no idea how things would work out when actually imaging.

Here are the results. I think I may have oversharpened them slightly in the processing. I’m a little rusty after not doing any planetary imaging for six months. Otherwise however I’m very happy with them. Processing was with PIPP, AS!2 and Registax v6.

montage

And just for fun here’s an animation of ten frames

jupiter-anim

Posted in Astronomy, Computing, Linux | Tagged , , , | 1 Comment

Linux support for Imaging Source USB CCD astronomy cameras

I’ve been on something of a mystery tour over the last few days trying to work out exactly what is required to get the Imaging Source USB CCD astronomy cameras working on Linux. What information I’ve been able to find has been incomplete or even totally wrong.

The cameras I’m talking about here are these:

  • DFK 21AU04.AS
  • DMK 21AU04.AS
  • DFK 21AU618.AS
  • DMK 21AU618.AS
  • DFK 31AU03.AS
  • DMK 31AU03.AS
  • DFK 41AU02.AS
  • DMK 41AU02.AS

Whilst I’ve not found one to test, I assume the “DBK” variants of the colour cameras will be the same. There may even be others. Reading some German web pages that turned up in Google after I’d found the solution and searched for it again suggests that there are some TIS cameras intended for use with microscopes that may be the same too.

There is the hint of a suggestion on some web pages that all of these cameras are actually UVC or very close to it, but plug them in and they aren’t recognised and the UVC driver does not load. Inspection of the code makes it fairly obvious that this is because the UVC driver supports Imaging Source cameras with USB Vendor ID and Product ID of 199e:8102, whilst all of the above cameras have 199e:8101.

Apparently in the past it has been necessary to downgrade the firmware on these cameras to get them to function on Linux. I don’t know how that worked, but despite the insistence of TIS in their support forums it is no longer necessary. Neither is it necessary to use the unicap library (though I assume it would work if you did).

For my 3.8.0 kernel (and I am led to believe for all v3 kernels), all that is required to get the camera to function with V4L2 after plugging it in is to do this (as root):


modprobe uvcvideo
echo "199e 8101" > /sys/bus/usb/drivers/uvcvideo/new_id

The UVC driver should then recognise the camera. The colour cameras will not produce debayered image frames so there’s still work to do there unless you use an application that can handle the debayering itself, but it is at least possible to get data out of the camera now.

It’s possible to configure udev to do run a script that will execute the two lines above when the camera is inserted. I have a script called /usr/local/bin/config-tis-camera.sh that looks like this:


#!/bin/bash
#
# Load and appropriately configure UVC video driver for the USB TIS CCD
# cameras

USB_ID="199e 8101"
/sbin/modprobe uvcvideo && echo $USB_ID > /sys/bus/usb/drivers/uvcvideo/new_id

and a udev rules file /etc/udev/rules.d/70-tis-cameras.rules


# Udev rules for TIS CCD cameras
#

ACTION!="add", GOTO="tis_end"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="tis_test"
SUBSYSTEM!="usb_device", GOTO="tis_end"

LABEL="tis_test"

ATTRS{idVendor}=="199e", ATTRS{idProduct}=="8101", RUN+="/usr/local/bin/config-tis-camera.sh"

LABEL="tis_end"

which works for me on Mint 15.

Posted in Astro Equipment, Astroimaging, Astronomy, Computing, Linux | Tagged | 3 Comments

Dehydrated to the core

It’s been a busy weekend fruit-wise. Yesterday the children and I collected some of our ripe dessert apples and cored, peeled and sliced them. It took about forty apples to fill our dehydrator which I left on overnight. The result is firm but not hard dehydrated apple rings with an intense flavour. I had intended that they might be used for snacks and packed lunches when the children are at school, but if they don’t finish them first, I might well…

IMG_0022

Posted in Smallholding | Tagged | Leave a comment

Home made pasta sauce base

The days are getting shorter and the remaining tomatoes in the polytunnel don’t look like they’re getting that much riper, so today we picked about two thirds of the ripest, which actually turned out to be far more tomatoes than I expected:

IMG_0021

Chopped into chunks on trays and given a splash of olive oil, garlic, herbs and for one tray, chiles, they were roasted in the oven for a few hours and then put through the food processor to remove the seeds and skins. The resulting sauce tastes fantastic, though the chile version may need a bit of calming down before anyone other than me will eat it.

Posted in Polytunnel, Smallholding, Veg plot | Tagged | Leave a comment

Fruits of my labour

A few days ago the children and I picked a decent basketful of crab apples from one of our trees. I reckon there must have been perhaps 3kg or so. A real pleasure as the last couple of years have provided a pretty poor harvest. I cleaned them up and got them into the preserving pan to boil down:

IMG_0016

After leaving the pulp in a jelly bag to drip through overnight I was rewarded this morning with about three and a half pints of liquid to which I added three and a half pounds of sugar and brought the lot to setting point. In the end I filled eight jars full of deep rich red crab apple jelly…

IMG_0020

I’m not sure eight jars will see us through the winter, but I’m now processing some cooking apple windfalls the same way to make apple and chile jelly which should help eke things out a little.

Posted in Smallholding | Tagged , | Leave a comment

Colour histogram and reticle for Linux capture app

Progress, progress…

Here’s my reticle and the colour version of the histogram. I may add some options for changing the style of the reticle and splitting the histogram into three, but those are for later. I also killed a few bugs yesterday and I’m now installing a load of different distributions so I can make up an alpha release.

hist-reticle

Posted in Astro Equipment, Astronomy, Computing, Linux | Tagged , , | Leave a comment

Mono histogram for capture application

I have the histogram working for mono cameras now. Colour is more work, but that will follow shortly. It doesn’t look too exciting mind.

histogram

Posted in Astro Equipment, Astronomy, Computing, Linux | Tagged , , | Leave a comment

ASI120MM capture support

Here’s capture support working in my new application for the ASI120MM, together with binning. I’m really not sure what use binning is for high frame rate image capture, but it works anyhow.

binning

Posted in Astroimaging, Astronomy, Computing, Linux | Tagged , , , | Leave a comment

Troubles with the ASI120MC

I started getting some problems with data from the ASI120MC in my capture application, with the image “tearing” or undebayered data appearing in what ought to be debayered frames as in these two examples:

colour-problem

debayer

It turns out that the problem relates to capture speed, frame size and USB traffic levels. It’s possible to pretty much control it by using the CONTROL_BANDWIDTHOVERLOAD option. In my current version of the interface library it takes parameters ranging from 40 to 100 and the default is 85. By lowering it to 45 I was able to get a steady image.

I’m really not sure what’s actually going on here. Perhaps buffers are getting overwritten whilst in use in the interface library or in the camera. It’s not at all clear to me what actual change the bandwidth overload control makes, nor what side-effects it might have either. I shall worry about that another time. I’d already intended to provide a dialog box with access to camera controls that the main application window doesn’t expose, so this will have to get added there when I get around to doing that part.

Posted in Astroimaging, Astronomy, Computing, Linux | Tagged , , , | Leave a comment

ASI120MC capture support

I’m now able to get an image from my ASI120MC:

zwasi120

The colour is all wrong. It turns out that whilst the header file gives the image format define as “RGB24”, it’s actually BGR24. I can probably write them to an AVI file unswapped and have it work, but I will need to swap BGR24 to RGB24 to use Qt’s QImage type. It doesn’t appear to be able to create a QImage from BGR24 data.

Actually, I lied. Qt has a QImage::rgbSwapped() function that will switch the red and blue over in a QImage. Sorted then.

Posted in Astroimaging, Astronomy, Computing, Linux | Tagged , , , | Leave a comment