Digital High-Pass Filters with Milder High-Pass Effect on Digital Images

: Image filtering consists of modifying the original image by logically “reimaging” it with a mathematical imaging device in which spatial response can be controlled by the user. Image filtering is performed by a mathematical operation called convolution, which is simply the successive replacement of each point in the original image by a new value produced by a weighted combination of the original point and its surrounding neighbour points. Filtering generally requires definition of a filtering kernel or small matrix; often a few filtering kernels are predefined in imaging computer systems. The filtering kernel is generally square with a matrix size of 3 × 3 pixels, 5 × 5 pixels or 7 × 7 pixels. We consider the use of two-dimensional, second-order derivatives for image enhancement. The approach basically consists of defining a discrete formulation of the second-order derivative and then constructing a filter mask based on that formulation. Ten spatial high-pass filters (masks) are developed, then implemented and tested in our laboratory by using programs that were written in Borland c ++ and visual Fortran. The results of the application of the developped Laplacian and Laplacian high-pass digital filters (masks) on digital images (either edge detection, sharpening of high frequency regions (fine details) accentuation), comparing between the effect of different dimensions filters 3 × 3 and 5 × 5 and milder high pass effect are presented and demonstrated. As the size of the filter (mask) gets larger and/or the weight of the center pixel of the kernel gets higher, the sharpenning effect becomes more and more. Second-order derivatives have a strong response to fine detail, such as thin lines and isolated points.


Introduction
Image processing, with the intent of improving display information, was one of the first applications of the computer in nuclear medicine (Brown et al., 1971). Image filtering consists of modifying the original image by logically "reimaging" it with a mathematical imaging device in which spatial response can be controlled by the user. The difference between a logical and a real imaging device (e.g., scintillation camera) is that the response function of the logical device can have negative values, whereas that of the real device can only be positive. The practical result of this difference is that the logical imaging device used for image filtering can be specified to improve spatial resolution and make edge and count density transitions more obvious. Alternatively, the response can be specified so that filtering smooths the image and reduces the noise so that small differences in count densities can be more readily perceived by the viewer (Erickson, 1985).
More information on general image processing may be obtained from different references (Gonzalez and Witz, 1977;Jain, 1988;Gonzalez and Woods, 2002) and more detailed descriptions of various nuclear medicine analysis techniques may be found in Gottschalk (1988;Erickson and Rollo, 1993).
The term filtering is used to indicate operations that either smooth or sharpen images; that is, increase or decrease image blurring. In planar nuclear medicine applications, however, only smoothing is frequently employed. While filtering can be described mathematically in complex terms, the actual operation is usually simple (Faber, 1994).
Filtering generally requires definition of a filtering kernel or small matrix; often a few filtering kernels are predefined in imaging computer systems. The filtering kernel is generally square with a matrix size of 3×3 pixels, 5×5 pixels or 7×7 pixels. The numbers contained in the matrix are called weights. In a sense, the kernel is placed so that its middle pixel is on top of one pixel in the image. The kernel will then cover a 3×3 (or 5×5, etc.) pixel region of the image (Faber, 1994).
The high-pass filter accentuates high-frequency spatial components while leaving low-frequency components untouched. A common high-pass mask is composed of a 9 in the center location with -1s in the surrounding locations as shown below (L1 Mask): We can see that the coefficients add to 1 and that smaller coefficients surrounded the large positive center coefficient.
The principal objective of sharpening is to highlight fine detail in an image or to enhance detail that has been blurred, either in error or as a natural effect of a particular method of image acquisition. Uses of image sharpening vary and include applications ranging from electronic printing and medical imaging to industrial inspection and autonomous guidance in military systems (Gregory, 1994).
The aim of the present study was to construct digital spatial high-pass filters (masks), applying these filters on digital images and comparing between the efficiency (enhancement the appearance of fine details in the image, tracing the borders (edges) of the small and large regions in the image), comparing between the effect of different dimensions filters 3×3 and 5×5 and milder high pass effect of these filters.

Theory
We consider in some detail sharpening filters that are based on first-and second-order derivatives, respectively.
The derivatives of a digital function are defined in terms of differences. A basic definition of the first-order derivative of a one-dimensional function f (x) is the difference Equation 1: We used a partial derivative here in order to keep the notation the same as when we consider an image function of two variables, f(x, y), at which time we will be dealing with partial derivatives along the two spatial axes.
Similarly, we define a second-order derivative as the difference Equation 2: In most applications, the second derivative is better suited than the first derivative for image enhancement because of the ability of the former to enhance fine detail. For this and for reasons of simpler implementation and extensions, we will focus attention initially on uses of the second derivative for enhancement.

Use of Second Derivatives for Enhancement-the Laplacian
We consider the use of two-dimensional, secondorder derivatives for image enhancement. The approach basically consists of defining a discrete formulation of the second-order derivative and then constructing a filter mask based on that formulation.
It can be shown (Rosenfeld and Kak, 1982) that the simplest isotropic derivative operator is the Laplacian, which, for a function (image) f(x, y) of two variables, is defined as: In order to be useful for digital image processing, this equation needs to be expressed in discrete form. There are several ways to define a digital Laplacian using neighborhoods. Taking into account that we now have two variables, we use the following notation for the partial second-order derivative in the xdirection Equation 4: And, similarly in the y-direction, as: The digital implementation of the two-dimensional Laplacian in Equation 3 is obtained by summing these two components Equation 6: This equation can be implemented using the mask shown below (Laplacian digital mask L2 Mask): The diagonal directions can be incorporated in the definition of the digital Laplacian by adding two more terms to Equation 5, one for each of the two diagonal directions. Since each diagonal term also contains a -2f(x, y) term, the total subtracted from the difference terms now would be -8f(x, y). The mask used to implement this new definition is shown in the following mask (L3 Mask): Because the Laplacian is a derivative operator, its use highlights gray-level discontinuities in an image and deemphasizes regions with slowly varying gray levels. This will tend to produce images that have grayish edge lines and other discontinuities, all superimposed on a dark, featureless background. Background features can be "recovered" while still preserving the sharpening effect of the Laplacian operation simply by adding the original and Laplacian images. It is important to keep in mind which definition of the Laplacian is used. If the definition used has a negative center coefficient, then we subtract, rather than add, the Laplacian image to obtain a sharpened result. Thus, the basic way in which we use the Laplacian for image enhancement is as follows Equation 6b: All the constructed high-pass filters depend basically on Laplacian masks (L2 and L3 masks) and Laplacian image that is represented mathematically by Equation (6a).

Simplifications
In practice, Equation 6a is usually implemented with one pass of a single mask. The coefficients of the single mask are easily obtained by substituting Equation 5 for

Methods
Image filtering is performed by a mathematical operation called convolution, which is simply the successive replacement of each point in the original image by a new value produced by a weighted combination of the original point and its surrounding neighbor points. Using larger filter functions, such as 5×5 or 7×7, will cause larger portions of the original image to have an effect on the value of the new image points (3).
The counts (density) in the image pixels underneath each element of the 3×3 kernel are multiplied by the kernel weights and the results are all summed together. The image pixel beneath the center of the kernel is replaced by this summation. This operation is repeated for every image pixel. Figure 1 shows the process graphically for 3x3 filter function. In this process, each image pixel is replaced by a weighted average of itself and some of its neighbours in its immediate neighbourhood. The following spatial high-pass filters (masks) are developed or constructed, then implemented and tested in our laboratory by using programs that were written in Borland c ++ and visual Fortran as shown in Appendices 1 and 2: /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, "c:\\borlandc\\bgi"); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); /* terminate with an error code */ exit (1) for(i = 0;i<= im_size;++i) for(j = 0;j<= im_size;++j)

Results
The results (effects) of the application of the developped Laplacian and Laplacian high-pass digital filters (masks from mask1 to mask10) on digital images, either edge detection, sharpening of high frequency regions (fine details) accentuation, comparing between the effect of different dimensions filters (3×3 and 5×5) and milder high pass effect are indicated and demonstrated on Fig. 2 to 9.

Discussion
Computer processing is a prerequisite for display and quantification of all modern medical images. The outcome of clinical reading and diagnosis directly depends on the technique and type of processing performed. The appearance of images can be drastically changed, which may either enhance or degrade the presentation of important information. Complicated mathematical techniques can be applied to image data to provide either accurate or inaccurate quantitative measures of physiological function. To ensure that image quality is enhanced and quantified values are correct, the user must have a competent understanding of the processing techniques (Faber and Folks, 1994).
General understanding of a processing technique includes the knowledge of what an operation really does, how it works and why it is important. The grasp of this information allows the user to adjust strategies to particular situations. Fully understanding the basis of processing procedures helps in solving problems and overcoming processing failures.
In spatial high pass filters the mask coefficients add to 1. A large coefficient generally appears in the center of the mask, surrounded by smaller positive and negative coefficients.
As the size of the filter (mask) gets larger and/or the weight of the center pixel of the kernel gets higher, the sharpenning effect becomes more and more ( Fig. 5 and 6 for 3×3 and 5×5 dimensions masks). Figure 4, high-passed Laplacian image, shows the result obtained using mask 5. The detail in this image is unmistakably clearer and sharper than in the original image. Adding the image to the Laplacian restored the overall gray level variations in the image, with the Laplacian increasing the contrast at the locations of graylevel discontinuities. The net result is an image in which small details were enhanced and the back-ground tonality was perfectly preserved. Results like these have made Laplacian-based enhancement a fundamental tool used frequently for sharpening digital images.
High-pass Laplacian can be applied for edge detection, this can be demonstrated by subtracting highpassed Laplacian image from the original image ( Fig. 2  and 3). The results obtained from subtracting (using mask 1) from the original image, for edge detection are similar to those that obtained by applying Robert Gradient http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobel.htm. In certain cases the results are better especially for images that have large regions of homogeneous intensities.
The fact that the high-pass mask contains a large positive coefficient in the center surrounded by smaller coefficients gives us a clue about its operation. It tells us that the center pixel in the group of input pixels being processed carries a high influence, whereas the surrounding pixels act to oppose it. If the center pixel possesses a brightness that is vastly different from that of its immediate neighbours, the surrounding pixel effect becomes negligible and the output value becomes an accentuated version of the original center pixel. The large difference indicates a sharp transition in gray level, which in turn indicates the presence of high frequency components (Gonzalez and Woods, 2002). We would therefore expect the transition to be accentuated in the output image. On the other hand, if the surrounding pixel brightness are large enough to counteract the center pixel's weight, the ultimate result is based more on an average all pixels involved.
It is interesting to note that if all pixel brightness in a 3×3 group are equal, the result is simply the same value. This is equivalent to the low-pass filter's response over constant regions. This means that the high-pass filter does not attenuate low-frequency spatial components. Rather, it emphasizes high-frequency components while leaving low-frequency components untouched.
Spatial high-pass filtering sharpens an image by accentuating high-spatial-frequency details. The convolution mask weighting coefficients are selected to vary the cutoff point where higher frequencies become accentuated. Additionally, high-pass filtering can render more visible any details that are obscured by haziness and poor focus in the original image. Further, the resulting high-pass filtered image can be summed with the original image to create milder highpass filter effects (Fig. 9).
High-pass filters are used to highlight high-frequency details within an image, such as lines, points and edges. Images that appear spatially dull or poorly defined can be sharpened with high-pass filtering techniques.
Accentuating high-frequency image information with high-pass filtering can enhance the characteristics of high-frequency objects of interest. For example, an image of a spatially detailed object-say, a noisy radiographic image and a noisy baby photograph can be enhanced by this way. If the Laplacian image is subtracted from the original image, by using mask 4, the high-pass effect will sharpen the lung and baby features ( Fig. 7 and 8).

Conclusion
As the size of the filter (mask) gets larger and/or the weight of the center pixel of the kernel gets higher, the sharpenning effect becomes more and more.
Second-order derivatives have a strong response to fine detail, such as thin lines and isolated points.
Sharpening could be accomplished by spatial differentiation, fundamentally, the strength of the response of a derivative operator is proportional to the degree of discontinuity of the image at the point at which the operator is applied. Thus, image differentiation enhances edges and other discontinuities (such as noise) and deemphasizes areas with slowly varying gray-level values (Gonzalez and Woods, 2002).
General understanding of a processing technique includes the knowledge of what an operation really does, how it works and why it is important. The grasp of this information allows the user to choose the suitable filters for particular situations. Fully understanding the basis of processing procedures helps in solving problems and overcoming processing failures.