A Novel Technique for Removing Jagged Edges of Image Due to Aliasing

In this paper we proposed an algorithm for handling the aliasing problem of the images. The proposed method is post processing approach which is applied after the image acquisition. The paper tries to restore the image quality which is affected by the aliased edges, and gives the image free from the effect. The resultant images will have smoother edges than the input image. The algorithm is fast as it does not use the complex mathematical structure and focused itself on the affected areas only. The result on the grayscale images have been displayed to prove the working of algorithm.


Introduction
Aliasing is a problem in image processing domain which affects the visual quality of the image. The main cause of aliasing is found to be the under sampling of the signal from which the image has been reconstructed. Mainly the problem of aliasing is faced by the computer generated images. The aliasing can be viewed as the jagged pattern in the areas of high frequencies in the images. The problem of aliasing affect the visuals in the computer graphics field., but the real time images are also get affected by this problem. The most effective way to remove the aliasing is to super sample the signal but it increase the cost of sampling and required high cost resolution hardware. The problem of aliasing is mainly considered and try to remove at the time of the construction of image by the graphics buffer. This problem cannot be fully handle and still create a non-desirable visual effect on the image. There are lot of ways to generate the output image like point sampling, area sampling, super sampling, adaptive super sampling etc. All these methods have their pros and cons in terms of quality and the cost.
In this paper we talked about an image post processing technique which is applied on the image after the reconstruction. Our main aim is to propose a technique which removes the aliasing problem from the digital images i.e. after the acquisition of the image.
The method we discussed in this paper is different from methods those are based on the shading approach. Most of the methods for antialiasing try to shade the nearby pixels of the aliased edge.
Many algorithms have been proposed to handle this problem from different perspectives.
In the proposed method on the adaptive post filtering which is based on curve fitting on the edges [1]. All the edge patterns are stored before in lookup table for simplicity and fast processing. Fitting a curve on the edges is rather a costly method and there are lots of patterns which cannot be fitted on the curve. The method has a step to create the index table for the image to handle the aliasing. The volume rendering method [2] using splatting is introduced for high depth images. Team from NVIDIA [3] proposed the Subpixel Reconstruction antialiasing (SRAA) to shade the nearby pixels of the aliased edge point. In their algorithm they take the geometric samples tells about the surface properties and shading samples which are for colors. By these samples pixels the current pixels is interpolated. There are some performance quality tradeoffs in the method. The parallel algorithm to restore the aliased edge is proposed [4] by Yiang et al. their method is highly parallelizable on the GPU. It is basically to restore the edges affected by thresholding, tone mapping or gamma correction etc. Initially antialiasising techniques were mainly concerned with graphics hardware and extensive oversampling which was handled through prefilter convolution [5], it uses the general shading method texture mapping and complex illumination. The combination of ray tracing and Image based Rendering technique is used to present a new way of antialiasing [6]. In the next section the proposed algorithm is discussed which is followed by the results to prove the claim.

Proposed Method
In this propose algorithm the main aim is to cut the sharp corners which are present on the edges to produce the smoothness. If we check the gap on the aliased edges the two functions can be performed on is to file the corners and another is to fill the deep points between the two edges jagged corners ( Figure 1).  to borrow the values of the edge corner for the edge deep and vice versa to some extent. By his we can produce relatively straight edge as compared to the corner ones. Another benefit of this method is that large corners get breaks into smaller ones which produce relatively better visual effects.
In the algorithm for every pixel we take a square window of odd size. We then make the four pairs of the pixels present on the extreme opposite side of the window (Figure 2). After selecting the pairs we take the difference between the two pixels of each pairs. If the pixels of the respective pair are from the same region then the difference between these pixels is lesser than the pixels form different region. The absolute difference is then sorted in the ascending order. We then find the average of the pairs pixel, the average is then sorted in ascending accordingly to the differences i.e. the average at the first position will be of that pair whose difference is minimum. The pixels of pair with the minimum difference are from the low frequency area and those can be used to remove the corner edge pixel or edge deep pixels. From the sorted average pairs the current pixel is replaced by the first average sorted through the indices of the differences.
This procedure is not applicable to all the pixels of the image we only want to manipulate the pixel which is mainly present on the high frequency regions because these are those areas where the probability of aliasing is very high.
For that the determination of edges or the aliasing zone is important. To find such points with high confidence is not an easy task.

Proposed Algorithm
For all Y(i,j) n ←{Size of mask } n1 ←floor(n/2) g ←{ The array of pixels in the mask of size n centred at (i,j)} p1 ←Y(i-n1 , j-n1) In the proposed algorithm we have Y (i,j) as the input image with the indexes i and j. The mask of size n is taken which is preferably of odd dimension. The points p1, p2, p2, p4, p5, p5, p7, p8 are the boundary points of the mask. The point's p1, p8 are from pair 1, the point p3 and p6 are from pair 2, the point's p2 and p7 are from pair 3 and the point's p4 and p5 are from pair 4. Then the difference between these consecutive pairs is calculated in rd, ld, vd and hd. The average of the points of each pairs are the calculated in the m1, m2, m3, m4 which are then stored in the array m. The values rd, hd, vd, ld are feed into array d. In the line 24 the sort function first sort the array d and then according to the d the array m get sorted. So, at the first position of the m we have the value from the pair which has minimum value in the array d. We check the first value of the array d whether it is less than some constant Φ, if the condition is satisfied then the value of the current pixel is replaced by the m [1] which is the paired value of d [1]. If the condition is not satisfied then keep the original pixel value as it was before.
The value for the constant Φ can change according to the problem figure and the outcome required. The images with low frequency areas and less shading can be enhanced using low value of Φ; otherwise the value can be increased accordingly. The size of the mask used for the calculation can also vary from one image to another. For the images having large jagged edges we can use the mask with the bigger dimensions and vice versa. In our test results we use mask of size from 3 X 3 to 11 X 11 as per the edge present in the images. Figure 3A: Image with jagged edges; 3B: Antialiased Images, Mask size (5 × 5).