Open and Shut [Equation of the Week]

For a discipline that relies so heavily on images, it is rather surprising how little use astronomy makes of the vast body of work on image analysis carried out by mathematicians and computer scientists. Mathematical morphology, for example, can be extremely useful in enhancing, recognizing, and extracting useful information from densely packed astronomical
images.

The building blocks of mathematical morphology are two operators, Erode[I|Y] and Dilate[I|Y], which operate on images I with smaller images Y called structuring elements. Typically, the structuring elements are simple kernels (such as 3×3 cells) and should be optimized for the type of structure that one searches for in the image. For example, a square kernel may be sufficient to enhance and extract sunspots from a magnetogram image, whereas rotating thin rectangular elements may be required for coronal loop extraction in EUV images.

The Erode[I|Y] operation picks out all the pixels in I which fully contain all possible translations of the structuring element Yz. Erosion therefore shrinks the regions of interest in an image, removing pixels that do not “look like” Y.

Erode[I|Y] = {z|Yz contained in I}

where z are all the points in I such that Y, translated by z, is contained within I.

The Dilate[I|Y] operation is like a reverse erosion, where all pixels in an image that overlap any part of the structuring element are included in the region of interest. Dilation acts like a convolution, and smooths out regions.

Dilate[I|Y] = {z| [Ŷz ∩ I] contained in I}

where Ŷ represents the structuring element that has been flipped about the origin.

Erosion and Dilation are applied in sequence to perform many useful operations on an image. Applying Erosion first and then Dilation results in reducing noise and enhancing structures. This is called an Opening operation. Conversely, when an image is first Dilated and then Eroded, it tends to smooth out the regions of interest into continuous lines, in a process called Closing.

Open[I|Y] = Dilate[Erode[I|Y]|Y]
Close[I|Y] = Erode[Dilate[I|Y]|Y]

Images may be Opened and Closed with different structure elements. Note that Opening removes pixels from the regions of interest, while Closing adds them. Essentially, Opening cuts off small links that may exist between large blobs, and Closing fills in thin crevices.

Other morphological operators let you thin a region, find the skeleton of a complex blob, prune small offshoots, etc. But while extremely useful, these operations come with a penalty — they are deterministic, and non-statistical, and produce no estimate of uncertainty. The only way I know of to estimate error bars on the end product is to carry out some kind of a sensitivity analysis by making a number of simulated images and running the same operators in the same sequence, and comparing the end results.

1. hlee:

I have the same awe as in your, …it is rather surprising how little use astronomy makes of the vast body of work on image analysis… I guess it’s due to different objectives in image analysis. Astronomers consider image analysis as data preprocessing for science. For computer vision people, image analysis itself is the main goal; cleaning images (noise removal), compressing images (noiseless coding and transmission), orthogonalize components (screening anomalies), and so on. There’s no physics in images unless known (such as poisson photon noise instead of gaussian). It’s pity that such vast reservoir of algorithms by mathematicians and computer scientists is of little use for error bar calculation.

By the way, the order in dilate and erode operators reminds me the process of compressed sensing. I was curious about any differences caused by random masking when I wrote compressed sensing and a blog. (No will to verify but from the flow chart of compressed sensing, masking could happen before or after photon read-ins.)

06-25-2008, 10:00 pm

Be advised that your thoughtful comment may not be submitted if too much time is spent. For a long comment, use an editor and copy the content into the box below. If unexpected submission denial happens, go back, copy the content, refresh the browser, paste the content, and then submit.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>