Two Way Approach For Detection and Removal of Scratches in Image

DOI : 10.17577/IJERTV3IS20708

Download Full-Text PDF Cite this Publication

Text Only Version

Two Way Approach For Detection and Removal of Scratches in Image

Kiran R.Sole

Department of Computer Science and Engineering G.H.I.R.E.M. Jalgaon, India

Prof. Swati Patil

Department of Computer Science and Engineering G.H.I.R.E.M. Jalgaon, India

Abstract Now a days as we are working with various types of images as well as with videos. These images can be natural images or artificial images. While working with this images it might be happened that some scratches or dust are there. So Inpainting is the process of reconstructing lost parts of images and videos. There are various methods to do image Inpainting like exemplar based image Inpainting in which patch of particular size is get selected and that patch is used to fill missing part of an image. In this confidence value and data value that is collectively known as priority value of that patch is calculated. And after this most similar patch from the source region is detected and pasted from filled part of that selected patch to missed part of target patch. But drawback of this method is redundancy of data values of target patch. Second method to do image Inpainting is directional median filtering. This algorithm is iterative. In the first iteration, median value of known pixels in each direction is calculated, and then, a damaged pixel is replaced by the median of the obtained values. In latter iterations, median of all pixels values in each direction is calculated then median of obtained values is copied in place of the damaged pixel. In exemplar based image Inpainting it may be happen that redundancy of patches get pasted so staircase effect is on image .So proposing a new method which is combination of exemplar based image Inpainting and median filtering to remove scratches in image. In this approach first patch having highest priority is calculated then on that patch spatial filtering process will be done. This spatial filtering process gives sharpening effect with noise. So to remove this noise two way hybrid median filtering will be done on that image. This method will be continued till whole region of missed part to be filled. Proposing approach reduces redundancy of patches in target region also removes noise from an image and removes complexity to search most similar patch in source region.

Keywords Exemplar Based Image Inpainting Image Inpainting, Median Filtering, Spatial Filtering, Two Way Hybrid Median Filtering.

  1. INTRODUCTION

    Line scratches are joint to blotches the major defects in degraded archived motion pictures. They appear in the image as lines of bright or dark intensity. With the recent growth of digital technologies and the ever increasing need for speed and storage, occluded or missing parts in images and is a more and more wide spread problem. This problem can be occurring in several applications such as digital movies. So removals of such errors are very important. There are number of algorithms are developed till are there to remove scratches.

    1] Texture synthesis based image Inpainting 2] PDE based Inpainting

    3] Hybrid Inpainting

    4] Image Inpainting Using Directional Median Filters 5] Exemplar based Image Inpainting

    1. Texture Synthesis based Image Inpaintings

      In this method, holes are filled by sampling and copying neighbouring pixels. Main difference between different texture based algorithms is how they maintain continuity between holes pixel and original image pixels. This method is only work for selected number of images, not with all. Yamauchi et.al presented algorithm which generate texture under different brightness condition and work for multi resolution [4].

      Texture synthesis based Inpainting method not perform well for natural images. These methods not handle edges and boundaries well. In some cases user need to enter which texture to replace with which texture. So these methods are used for small area of Inpainting.

    2. PDE based Inpainting

      First PDE base approach given by Bertalmio et.a. It uses the concept of isophotes (linear edges of surrounding area) and diffusion process. Main problem with this method is that due to blurring effect of diffusion process replication of large texture is not perform well [1].

    3. Hybrid Inpainting

      In this method, PDE and texture synthesis based Inpainting methods are combined for filling holes. Here main goal is to decompose image into texture and structure region. Then corresponding regions are filled by texture synthesis and edge propagating algorithms respectively [1]. It require more computational time for large holes.

    4. Image Inpainting Using Directional Median Filters

      In this paper a new digital image Inpainting algorithm based on Directional Median filters is proposed. The proposed algorithm is iterative. In the first iteration, median value of known pixels' in each direction is calculated, and then, a damaged pixel is replaced by the median of the obtained values. In latter iterations, median of all pixels' values in each direction is calculated then median of obtained values is copied in place of the damaged pixel. The algorithm

      is fast and provides adequate results in sharp edges regions. But this method is harder to implement.[2].

    5. Exemplar based Image

    Inpainting in exemplar-based Inpainting approach was reported in which missing regions are inpainted on a patch by patch basis. In this, both structure and texture are considered through confidence term and data term in the calculation of patch priority. The Inpainting approach in gave impressive results especially in the cases of large miss region. Therefore, the exemplar-based Inpainting approach has drawn more and more attention since then and many researchers have involved in the field.

    `In this paper, a new method to remove the film scratches is proposing, which compensates the performance of the exemplar-based Inpainting with the two way hybrid median filter. When a scratch is detected, this method first applies the exemplar-based Inpainting to find the patch having highest priority. Then, on that patch spatial filtering will be done. And on that image two way hybrid median filtering will be done. Spatial frequency defined as the number of changes in brightness values per unit distance for any particular part of an image. If there are few changes in brightness value over a given area a low frequency area. If values changes dramatically over very short distances, this is called high frequency area.

    In this paper, first how to detect the scratches is mentioned, and then the principle of the proposing method composed of exemplar-based Inpainting and the two way hybrid median filter is explained.

  2. PRINCIPLE OF SCRATCH DETECTION Typically, film scratches appear on a frame as thin vertical

    lines. Its brightness is quite high or low, but it is not always completely white or black. Several methods can be considered to detect the scratches, but here we adopt Hough transform[3], since Hough transform can detected broken and noisy scratches well. Principle of scratch detection is as follows. First, edge detection is performed in each frame using Cannys method[5]. Then, straight line components are detected from the edge image using Hough transform. Scratches are extracted from the detected straight line components considering the verticality, the pixel values, and sudden appearance.

  3. PRINCIPLE OF SCRATCH REMOVAL

    1. Proposing method of Scratch Removal

      The template is designed so that author affiliations are not repeated each time for multiple authors of the same affliation. Please keep your affiliations as succinct as possible (for example, do not differentiate among departments of the same organization). This template was designed for two affiliations.

    2. Calculation of Restore Priority Value

      The order to restore the damage area is determined by the restore priority value. Here Fig. 2 gives notations.

      Fig.2 Notations .

      The priority value is larger at the location where the edges hit the boundary of the damage area. The priority value

      is obtained as follows.

      P(p) = C(p)D(p)

      We call C(p) the confidence term and D(p) the data term, and they are defined as follows:

      C = () () , =

      |

      | |

      Where | p |= is the area of p,

      is a normalization factor (e.g., = 255 for a typical grey- level image),

      np =a unit vector orthogonal to the front in the point p

      =denotes the orthogonal operator.

      The priority P(p) is computed for every border patch, with distinct patches for each pixel on the boundary of the target region.

      During initialization, the function C(p) is set to C(p)

      = 0 , and C(p) = 1

      The confidence term C(p) may be thought of as a measure of the amount of reliable information surrounding the pixel p. The intention is to fill first those patches which have more of their pixels already filled, with additional preference given to pixels that were filled early on (or that were never part of the target region)[6].

    3. Principle of Removal of Scratches using Spatial Filtering and Two Way Hybrid Median Filtering.

      Algorithm which perform image enhancement is called as filtering. Filtering is performed by using convolution windows. These windows are called mask, template, filter or kernel. In the process of filtering, the window is moved over the input image from extreme top left hand corner of the scene.

      When missed part of patch is detected , that missed part get replicated by adjacent pixels and on that patch filtering will be done. Fig.3 to 6 shows Spatial Filtering process.

      Fig. 3 Select Patch having Highest Priority

      123

      112

      244

      243

      189

      100

      255

      121

      122

      240

      178

      134

      123

      111

      145

      178

      134

      144

      221

      121

      134

      134

      144

      222

      233

      Fig.4 Replication of adjacent pixels from filled part to missed part, given in bold pixels.

      Now, on that patch filtering will be done by taking convolution window having fixed ratio that is 1/9.

      Selected Patch

      *

      Filtering Convolution Window

      123

      112

      244

      243

      189

      1/9

      1/9

      1/9

      1/9

      1/9

      100

      255

      121

      122

      240

      1/9

      1/9

      1/9

      1/9

      1/9

      178

      134

      123

      111

      145

      1/9

      1/9

      1/9

      1/9

      1/9

      178

      134

      144

      221

      121

      1/9

      1/9

      1/9

      1/9

      1/9

      134

      134

      144

      222

      233

      1/9

      1/9

      1/9

      1/9

      1/9

      Fig 5.Spatial Filtering

      This spatial filtering gives Sharpening effect on image but containing with noise. So to remove this noise use two way

      hybrid median filtering.

      Fig.6 Spatial Filtering Technique.

      Suppose patch of 3*3 is taken having highest priority pointing pixel values say a, b, c. And formula will be carried out.

      The above is repeated for every pixel in the original image to generate the filtered image.

    4. Two-way hybrid median kernel

      Two median values are calculated. Mr is the median of horizontal and vertical "R" pixels, and Md is the median of diagonal "D" pixels. The filter value is the arithmetic mean of the two median values and the central pixel C, that is.

      Fig.6 Hybrid Median Filter

      Here box or patch size is 5*5 and now on that patch hybrid median filtering will be done[7].

      Median= (Mr+ Md+ C) / 3

      The above is repeated for every pixel in the original image to generate the filtered image.

      Advantages of Median are: 1] Its simple to understand.

      2] The median filter preserves brightness differences resulting in minimal blurring of regional boundaries.

      3] Preserves the positions of boundaries in an image, making this method useful for visual examination and measurement.

      Input Image

      Scratch Detection

      Find Patch Having Highest Priority

      Apply Spatial Filtering

      Apply Two Way Hybrid Median Filtering

      Output Image

      Fig.1 Flowchart of proposing system

  4. ADVANTAGES

By proposing this new method following advantages can be achieved.

1] As given in [6] similar patch needs to be finding in source region , so by using this method no need to find patch in source region. So reducing the time complexity.

2] Redundancy of patch can be avoided. As given in [4] it can be happen that same patch can be pasted in target or missed region. So in proposing method we are avoiding that by considering only highest priority patch.

3] By using two way hybrid median filter noise which is present in image can be remove.

CONCLUSION

Since Exemplar Based Image Inpainting gives better performance and Median filtering also provides better efficiency. So by combining these two methods and proposing method removal of scratches from image can be possible.

REFERENCES

    1. Pritika Patel, Ankit Prajapati,Shailendra Mishra, Review of Different Inpainting Algorithms,2012 International Journal of Computer Applications (0975 8887) Volume 59 No.18.

    2. H. Noori,Saeid Saryazdi,"Image Inpainting Using Directional Median Filters",2010 International Conference on Computational Intelligence and Communication Networks,DOI 10.1109/CICN.2010.20

    3. D.H. Ballard, "Generalizing the Hough Transform to Detect Arbitrary Shapes", Pattern Recognition, Vol.13, No.2, pp.111-122, 1981

    4. M. Bertalmio, L Vese, G. Sapiro, and S. Osher. Simultaneous structure and Texture Image Inpainting,to appear ,2002.

    5. Yuki Umeda* and Kaoru Arakawa, Removal of Film Scratches Using Exemplar-BasedInpainting With Directional Median Filter, IEEE

      978-1-4673-1157-1/12

    6. Criminisi, Patrick Perez, and Kentaro Toyama. Region filling and object removal by exemplar-based inpainting. IEEE Transactions on Image Processing, 13(9):1200 1212, September 2004.

    7. Ehab Aboudaya,Median Filtering, Machine Vision And Digital Image Analysis, October 2007

Leave a Reply