The AstroStat Slog » set theory http://hea-www.harvard.edu/AstroStat/slog Weaving together Astronomy+Statistics+Computer Science+Engineering+Intrumentation, far beyond the growing borders Fri, 09 Sep 2011 17:05:33 +0000 en-US hourly 1 http://wordpress.org/?v=3.4 Open and Shut [Equation of the Week] http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-open-and-shut/ http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-open-and-shut/#comments Wed, 25 Jun 2008 17:00:24 +0000 vlk http://hea-www.harvard.edu/AstroStat/slog/?p=326 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.

]]>
http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-open-and-shut/feed/ 1