Monday, February 27, 2012

From the realm of the galaxies to the microcosm: A thin-section gigapan

I've been looking forward to posting this image (and linking to the corresponding GigaPan) for a long time.

(Click here for the zoomable GigaPan mosaic at

The image in today's post is a 156-panel mosaic of something called a thin section; it's a `geology thing', in contrast to the `astronomy things' that I've been imaging so far. Basically, it's a piece of rock (from Vermont, in this case) that's been ground so thin, light will shine through it. When viewed with the right kind of microscope, thin sections commonly show bright colors, along with variations in light-vs-dark from grain to grain. The area shown in this image is about 12mm by 18mm. This thin section is one of a set that have been at De Anza College for many years. Students in our introductory geology course look at these thin sections when they're learning to identify the different rock textures. I don't know when these thin sections were made, but I'd guess they date from the 1960s or 1970s

I've written a more detailed explanation in the `About This GigaPan' notes - if you're interested, you can scroll down below the panorama, and my notes are below the camera and image information.

Acquiring the image data:

Instead of a telescope, I had to use a microscope. I used a `trinocular petrographic microscope' that I got from The Microscope Store a few years back, when I was just dying to have my own petrographic microscope. The scope is `trinocular' because not only does it have a binocular viewer for viewing the magnified image with one's eyes, but it has a third port for attaching a camera.

For photographing thin sections, I used a Canon 20D DSLR camera. This is the same one I used when I started digital astro-imaging, several years back. To attach it to the microscope, I kludged an Orion 1.25" eyepiece-projection adapter, which happily fit right over the non-telescope-sized microscope eyepiece quite nicely! The image focuses on the camera sensor, and since it's a DSLR, I can check focus and framing right through the camera viewfinder.

The basic idea behind acquiring data for an image of this type is to shoot lots of adjacent frames, with some overlap. In that sense, it's like a large astronomical mosaic. However, since each frame only takes a fraction of a second to shoot, I can take hundreds of frames. The big difference between deep-sky imaging and microscopic imaging is that I have a nice bright light source (i.e. an incandescent bulb built into the scope). It's much easier to achieve a high signal-to-noise ratio that way!

The thin section is a small glass slide, and I moved the slide between frames. This was accomplished by means of a small slide positioner, which holds the slide and moves in two directions when I turn some small knobs. The positioner has a vernier scale on each axis, so I can make a precise 1.5-mm movement between adjacent frames in a given row, and then move 1mm between rows. This gives the GigaPan Stitch software enough overlap to work with.

Preliminary data processing:

I used Adobe Photoshop CS4 to batch-process the raw 16-bit CR2 files that came off of the camera. I used CS4's Camera Raw module to take out some slight chromatic aberration, and after converting the images to 8-bit JPEG format, I did a bit of sharpening and color saturation. The GigaPan stitching process seems to have desaturated the image a bit. Perhaps I should pre-saturate each image a bit more.

Assembling the mosaic:

This couldn't have been easier! I just turned GigaPan Stitch loose on the image files, and it made a mosaic, which is about 30,000 pixels wide! Simplicity itself. I ran the stitcher on a Mac Pro computer, which made short work of the operation. I had heard that GigaPans can take all night to run, but the Mac Pro banged this sucker out in under 15 minutes. Somewhere, Steve Jobs is smiling.

An Unsung Hero:

Somewhere in China is the real hero of this little technological story. The microscope I used is a Chinese-made import, and it's a mixed bag of build quality. Some things on the scope are perfectly serviceable, and other things could stand to be better. Centration of the objective lenses (something like collimating a telescope) is hard to do, and the objectives don't stay centered for very long. I took the whole objective turret apart, and saw that certain detents in a metal part appeared to have been cut into the metal rather haphazardly. The binocular viewer leaves something to be desired, too - it has some annoying internal reflections, and gives a partially-cross-polarized view even when the `analyzer' (one of the polarizing filters) is out of the optical path. However, this microscope really shines in one important area - the flatness and sharpness of the image field. Man, that thing is flat! By that I mean that there are almost no visible aberrations from the center of the field to the edge, at least in the low-power objective. And there are very few diffraction artifacts visible on high-contrast edge features, which is more than I can say for a more-expensive Japanese-made microscope at school, even when it's adjusted for Kohler illumination. (Sorry for this microscope geekery, interested readers may want to look at the Nikon or Olympus microscopy websites.)

Who knows if I'm correct in my speculations, but I can't help imagining an optical designer in China somewhere, making those objectives as perfect as possible, out of love for the craft of optical design. Somehow or another, they made those things so as to deliver a really remarkable level of performance (at least as judged by my eye), despite the relatively low price point. Whether by luck or by design, the image quality of those objectives largely makes up for the deficiencies in other parts of the microscope.

A Dream of Automation:

As I described in the `About This GigaPan' notes, I have this dream of motorizing the stage-positioner controls, so as to be able to automate the acquisition of the image data. I'd love to be busily grading papers, or surfing the web, or processing images, while the microscope and a computer are robotically churning out the data for another enormo-mosaic. It's quite a bit like my dream of having a robo-focus unit for my telescope, so that I could acquire image data automatically while doing visual observing. One can dream!

Friday, February 3, 2012

The Orion nebula: Reworking some year-old data

If you've not yet had the opportunity to look at M42, the great Orion nebula, through a telescope, you owe it to yourself to try and find an opportunity to do so. Even though today's entry is part of an `imaging blog', M42 is the kind of object that's beautiful any way you look at it. As long as you've got a clear sky, and are (hopefully) away from city lights, you can see this nearby star-forming complex in some way, regardless of the gear you've got.

I just now spent a moony evening reworking some unbinned R, G, and B data that I shot about a year ago. Every winter, it's the same old routine: Try to get some decent data on M42. Something always gets in the way, though. In early 2011, it was bad weather and camera issues... a story for another time. I managed to shoot some unbinned L, R, G, and B data, but not a heck of a lot. To the best of my memory, the data for this image don't amount to much more than several hours total. Since it's now February, and I'm not 100% sure if I'll get in a decent M42 dataset in 2012, I thought I'd fool around with this old stuff from last year. See if I could make something semi-presentable.

After an evening spent in front of the computer, I happened to go outside, and as I was walking back in, I looked up, and there he was: Orion, the hunter. The constellation was just passing across the meridian, with the bright gibbous moon due north of it. Even with lights in my eyes, and under a city sky, I could make out the bright stars that delineate the pattern: Betelgeuse, Rigel, Bellatrix, Saiph, Alnitak, Alnilam, Mintaka. And there was the sword of Orion, with the middle `star' being M42. This object is so bright that it (or at least the stars in and around it) can be seen under almost any sky, it seems.

Unlike most deep-sky objects, M42 is worth looking at with virtually any optical instrument. The belt and sword of Orion are great in binoculars. Small telescopes show the nebulosity. Large telescopes under dark skies provide one of the few `imaging-like' experiences in visual observing. A greenish color can even be seen in the brightest part of the nebula, in a big scope. The details just go on for days and days.

As an imaging project, M42 presents an almost limitless field of challenges and rewards. With modest equipment and short exposures, one can still get something. Advanced imagers have gotten some incredible results.

Processing in Pixinsight:

This image certainly isn't incredible, but I'm glad that I was able to squeeze a bit of detail out of such data as I had. I spent a fair amount of time on this in Pixinsight, and eventually I gave up on trying to combine the luminance data with the color data. Both my RGB image and my Luminance image were the result of high-dynamic range combinations, for which I'd shot long- and short-exposure frames. Matching the histogram from the L image to the histogram from the RGB image seemed to be taking forever, with little end in sight. I bailed and just went for the RGB.

Getting a good color balance was really tricky, and I just couldn't get it quite right. The stars in the linear image had all sorts of blue and cyan issues, and by the time I got them to look semi-normal, the blue color in the nebula was pretty well gone. I could have (and should have) worked that problem harder, but since this was a `let's see what we can get out of this stuff without too much struggle' project, I didn't sweat it that hard.

I did a bit of Richardson-Lucy deconvolution while the image was still linear, but nothing drastic. I would have liked to have gotten a better sharpening result, but I found that I kept getting bright `wormy' artifacts if I wasn't careful. I think that a really good deconvolution would be pretty substantial project, even with the help of Dynamic PSF.

After histogram stretching, I had to spend a fair amount of time finding the right parameters for an application of HDR Multiscale Transform, to knock down the over-brightness of the area around the Trapezium. Once I got that area tamed, it was rather washed out, as usual. Some additional luminance masking and an extra saturation boost in that area helped a bit, although it left some purple haze around the Trapezium stars.

There's plenty of room for improvement in this image, but I'm glad that I can at least post some sort of M42 image. I hardly feel like `an imager' without one. With a little luck, maybe I can finally get a decent set of data later this month and in March. It would be nice to really go deep on this thing, and under good seeing. We'll see how it goes!

As per usual, there's an amazing image of the object from the Hubble Space Telescope.