Else

NEXT x

In the procedure, min is the neighborhood minimum and max is the neighborhood maximum. Initially, they are set to the highest and lowest pixel values in the image, and then tested against each pixel in the neighborhood. Finally, we compute the difference between the current pixel and the minimum, and assign the closer value to a pixel in the new image.

What does this procedure accomplish? Consider what happens in a uniform region, a region with small variations, and a region with large variations.

• Uniform region: Here the current pixel, the minimum, and the maximum value are the same. The new image is exactly the same as the old one.

• Region with small variations: In each neighborhood, the extreme value operator assigns the current pixel the value of the lowest or highest neighborhood pixel. In a nearly uniform region with just a few low- or high-value pixels, the current pixel is forced to the local minimum or maximum, which is likely to represent low-contrast detail in the image. Any pixel that is on or near a border between two regions with a different average brightness is forced to join (that is, take on the characteristic pixel value of) one region or the other.

• Region with large variations: Similar to regions with small variations: local highs and lows are accentuated because the current pixel is forced to become part of a feature or part of the local background. Transitions between areas of different pixel value become abrupt.

The size of the neighborhood should be two to three times greater than the characteristic size of the image detail. For Nyquist-sampled images of the Moon and planets, a radius of 2 or 3 (i.e., 5x5 and 7x7 neighborhoods) can produce a dramatic edge enhancement.

The extreme value operator is useful for clarifying and delineating detail in planetary and lunar images, and produces interesting effects on those of faint deep-sky objects. It sharpens transitions and accentuates edges and boundaries. Images processed using it can reduce subjective factors in the measurement of sizes, shapes, and areas, such as the latitude extent of the Martian polar caps, or the size and orientation of elliptical galaxies.

•Tip: In addition to the minimum/maximum extreme value operator, AIP4Win includes a three-level version in which the current pixel is forced to the minimum, the median, or the maximum of the

Figure 15.6 Local adaptive sharpening accentuates subtle small-scale features without looking unduly artificial. By applying an unsharp mask under the control of a routine that senses the contrast level in the original image, it increases sharpness where the existing contrast is too low to see easily.

Figure 15.6 Local adaptive sharpening accentuates subtle small-scale features without looking unduly artificial. By applying an unsharp mask under the control of a routine that senses the contrast level in the original image, it increases sharpness where the existing contrast is too low to see easily.

neighborhood. This variant does not sharpen as strongly, but the resulting images look smoother.

15.2.2 Local Adaptive Sharpening

Local adaptive sharpening is an unsharp mask for which contrast is controlled by neighborhood statistics. Although the algorithm does not contain a conditional statement, it is strongly nonlinear because it alters the local statistics of the image.

In linear unsharp masking, the mask is formed as an average of the neighborhood. The difference between the current pixel and the mask is then amplified by a constant contrast factor and added back to the current pixel value. In this way deviations in pixel value, presumably representing image detail, are enhanced.

In local adaptive sharpening, however, rather than using a constant contrast factor, we compute the ratio of the average pixel value of the neighborhood to the standard deviation of the neighborhood. Where local image contrast is high, the resulting contrast factor is low. In regions where image contrast is low, the standard deviation is small, and the contrast factor becomes large.

The unsharp mask is formed by summing pixel values in the neighborhood in the variable pvmean, and then dividing by the number of pixels, numpixels, to obtain the mean pixel value, pvmean. The difference between the current pixel and the mean pixel value is stored in the variable dif f.

Figure 15.7 Although belts and zones are present in the original, they are soft and ill-defined. The extreme value operator adds definition to cioud and zone edges. Local adaptive sharpening does wonders to enhance the fine Jovian detail. The multiplicative rank process is overly harsh. Jupiter image by Donald Parker.

Figure 15.7 Although belts and zones are present in the original, they are soft and ill-defined. The extreme value operator adds definition to cioud and zone edges. Local adaptive sharpening does wonders to enhance the fine Jovian detail. The multiplicative rank process is overly harsh. Jupiter image by Donald Parker.

The standard deviation is:

V n where n is the number of pixels in the neighborhood, and P is the mean pixel value of the neighborhood. In the procedure below, the square of the deviation from the mean accumulates in the variable s ig. Once the sum is computed, it is divided by n - 1 and the square root is extracted. The mask value, stored in dif f, is then multiplied by the contrast factor, pvmean/sig, and added to the original pixel value.

Here is the complete algorithm:

FOR x = xradius TO xmax - radius FOR y = yradius To ymax - radius numpixels = 0 pvmean = 0

FOR i = x - radius TO x + radius FOR j = y - radius To y + radius numpixels = numpixels + 1 pvmean = pvmean + old(i,j) NEXT j NEXT i pvmean = pvmean / numpixels diff = old(x,y) - pvmean sig = 0

FOR i = x - radius TO x + radius FOR j = y - radius TO y + radius sig = sig + (old(i,j) - pvmean) A 2 NEXT j NEXT i sig = SQRT(sig / (numpixels - 1)) diff = diff * pvmean / sig new(x,y) = old(x,y) + diff NEXT y NEXT x

Local adaptive sharpening operates very strongly on images with low contrast—such as planetary disks—but has little effect on those that are already full of rich detail, such as the lunar surface near the terminator. It works well on images with high signal-to-noise ratios, but on noisy images it can enhance noise in uniform areas. Users should remain alert to this tendency, especially when relying on single images.

• Tip: In AIP4Win, you can select a separate contrast factor that further amplifies the contrast factor computed from the image statistics, giving you control over the total contrast enhancement applied to the image.

Was this article helpful?

0 0
Telescopes Mastery

Telescopes Mastery

Through this ebook, you are going to learn what you will need to know all about the telescopes that can provide a fun and rewarding hobby for you and your family!

Get My Free Ebook


Post a comment