Emily LakdawallaOct 19, 2010

Every-other-line truncation of Cassini images

If you have ever looked at Cassini images of icy moons, either on the raw images website or at the Planetary Data System, you may have noticed images that look like they are being eaten by weird black sawtooth pattern. Some images have just a little bit of this sawtooth:

Rhea with a little sawtooth truncation

NASA / JPL / SSI

Rhea with a little sawtooth truncation
N00164532.jpg was taken on October 17, 2010. The camera was pointing toward RHEA at approximately 54,330 kilometers away, and the image was taken using the CL1 and CL2 filters.
Rhea with a lot of sawtooth truncation

NASA / JPL / SSI

Rhea with a lot of sawtooth truncation
N00164490.jpg was taken on October 17. The camera was pointing toward RHEA at approximately 46,805 kilometers away, and the image was taken using the CL1 and GRN filters.

Let's examine one of these images very closely.

Zooming in on every-other-line truncation

NASA / JPL / SSI

Zooming in on every-other-line truncation
N00164465.jpg was taken on October 17, 2010. The camera was pointing toward RHEA at approximately 43,203 kilometers away, and the image was taken using the CL1 and CL2 filters. This is a small cropped piece of the original image, enlarged 2x using a nearest neighbor algorithm to preserve the hard edges.

If you look at a lot of Cassini images, you may notice that the black stripes appear most often on images of icy moons. If you're sharp, you'll notice that the black stripes only seem to cover bits of icy moon, but not the black space behind them. And if you're extra sharp, you'll have noticed that the lines are longer when there are more bits of topography (usually craters) throwing dark black shadows in the image. What is going on? Are the aliens eating Cassini's photos of Saturn's icy moons in order to hide evidence of their bases?

(That last comment was, of course, just to poke fun at everybody who went to town on the "NASA is hiding something, it's a conspiracy" frenzy last week over my version of Cassini's April images of Titan and Dione.)

With a little research, you can find a description of why this black sawtooth pattern appears. In The Cassini-Huygens Mission: Orbiter Remote Sensing Investigations, edited by Chris Russell, Carolyn Porco and her coauthors explain. It's in a section that follows an explanation of how Cassini's cameras, called the Imaging Science Subsystem (ISS), captures images with gray levels recorded at a depth of up to 12 bits per pixel (4,096 different gray levels), but can reduce the bit depth to 8-bit (256 gray levels) before transmission to Earth. From pages 461-2:

3.9.2. Lossless Compression
oth converted (8-bit) and unconverted (12-bit) data can be losslessly compressed. The ISS lossless hardware compressor is based on Huffman encoding, a high-efficiency, numerical encoding scheme in which the length of the bit sequence used to encode a given number is chosen based on the frequency of occurrence of that number. In ISS lossless compression, each compressed image can be reconstructed on the ground with no loss to the information content of the image, provided the image entropy does not exceed the threshold where 2:1 compression is achieved. Scenes with low entropy will have compression ratios higher than 2:1; scenes with high entropy will never compress greater than 2:1, but the ends of lines will be truncated so that the total amount of data returned in a pair of lines of the image never exceeds the total number of bits for a single uncompressed line. The truncation scheme has been designed so that the truncation alternates -- i.e., every other line -- from one line to the next, on the right (large sample number) side of the image. If the data loss is great, it can in principle result in the complete loss of every other line. In either case, with this scheme information (though reduced in spatial resolution) can be retained across the image, even at the edges.

But where the pixel values vary a lot, the Huffman encoding scheme can't achieve a file size reduction of a factor of 2. Pixels vary a lot where there is bright terrain (icy surfaces) pockmarked with craters (making dark shadows) so this every-other-line truncation is almost never seen in pictures of Saturn or Titan, with their smooth atmospheric variations, but is noticeable on most of the images of the other moons where the moon totally fills the field of view. On these images, Cassini tries to stuff each pair of image lines into a box that can only fit a little bit more than one line of image data inside. If any image data spills over, it doesn't make it into the box, and never gets transmitted to Earth. When the computer on Earth unpacks the boxes of data that were transmitted from Cassini, there's something missing, the information that "spilled out of the box" back on the spacecraft. The computers on Earth can't have any way of knowing what went into those pixels when they were aboard Cassini, so they just write black space into those pixels.

These images have an ugly appearance when they are raw and unprocessed. But although those black pixels represent data that is lost and gone forever, all the other pixels in the image were recorded in such a way that they represent the original data -- they were losslessly encoded. So you can reconstruct what that part of the image originally looked like in reasonable fidelity, using the adjacent pixels that didn't get eaten up by the algorithm. (At least you can reconstruct them if you go into the Planetary Data System and get the high-quality science data. When you are working from the raw images website, the images have been lossily compressed in JPEG format so you cannot reconstruct them perfectly.)

A quick shortcut for reconstructing the missing data in Photoshop is as follows. Select the area of the image that is affected by the every-other-line truncation using the marquee tool. Go to the Filter menu -> Video -> De-interlace... A dialog box will ask you if you want to de-interlace the Odd or the Even fields, and if you want to create new fields by duplication or interpolation. Generally, you want Interpolation, but whether you want Odd or Even fields depends on whether the black lines are the odd or even lines in your selection. Try the default (Odd fields), and if you get an even worse looking black sawtooth pattern, Undo and try it again with the Even fields. Here's a blink comparison after the application of the Photoshop filter.

Rhea, truncated, then de-interlaced

NASA / JPL / SSI / animation by Emily Lakdawalla

Rhea, truncated, then de-interlaced
N00164465.jpg was taken on October 17, 2010. The camera was pointing toward RHEA at approximately 43,203 kilometers away, and the image was taken using the CL1 and CL2 filters. A small section was cropped out and the every-other-line truncation repaired using the De-Interlace filter in Photoshop.

Raw images from this post include: N00164465, N00164490, and N00164532.

Let’s Go Beyond The Horizon

Every success in space exploration is the result of the community of space enthusiasts, like you, who believe it is important. You can help usher in the next great era of space exploration with your gift today.

Donate Today