IJTC201604001-Restoration of Image Using KNN Algorithm
IJTC201604001-Restoration of Image Using KNN Algorithm
ISSN-2455-099X,
Volume 2, Issue 4 April 2016.
Abstract: - This paper analyzes coding algorithm of JPEG image and proposes a K-Nearest
Neighbor (KNN) approach to perform in painting in the DCT Coefficients to get a more
optimized compression ratio. The proposed methodology is expected to outperform the
compression ratio of the Baseline JPEG Algorithm dealing with images having cracks and
distortions. The reason behind this is plain and simple. Images having distortions will have
anomalies in the distorted parts which will contribute to the size of the image. If those distortions
are removed before compression, the output will be more optimized.
TC
.O
Keywords: DCT, JPEG, KNN, PSNR, SSIM (Structural Similarity Index Measurement)
IJ
Introduction
Image restoration is based on the attempt to improve the quality of an image through knowledge
of the physical process which led to its formation. The purpose of image restoration is to
"compensate for" or "undo" defects which degrade an image. Degradation comes in many forms
such as motion blur, noise, and camera misfocus. In cases like motion blur, it is possible to come
up with a very good estimate of the actual blurring function and "undo" the blur to restore the
original image. In cases where the image is corrupted by noise, the best we may hope to do is to
compensate for the degradation it caused. Image restoration differs from image enhancement in
that the latter is concerned more with accentuation or extraction of image features rather than
restoration of degradations. Image restoration problems can be quantified precisely, whereas
enhancement criteria are difficult to represent mathematically.
distortion can be modelled as noise or a degradation function. To restore an image from a noise
model, different filters like median filter, homomorphic filters are used.
Overview of Restoration
A categorization according to the degradation model (noise, blur or both)
Another possible categorization:
o Spatial domain techniques
Compression Ratio
Compression Speed
Complexity
Decompression Speed
Average
Very Fast
Simple
Fast
Run-Length
Coding
Replaces runs of
two characters
single Code.
Good
Fast
Very Simple
Fast
Arithmetic Coding
Use occurrence and
cumulate-ive to
represent the source
image
Very Good
Slow
Complex
Slow
TC
.O
Task
Replaces fixed
length code by
variable length.
Bayesian techniques make use of a priori knowledge about the unknown, undegraded
image statistical image modeling
Total variation involves regularization
Penalization of not-desired local image structures Statistical image modeling.
Modeling marginal statistics (image histograms)
IJ
Compression Algorithm
As stated above, Image compression Algorithms can be partitioned into: Lossy and Lossless.
Decompression after lossless compression yields the same input image. Lossy compression
brings about loss of information and the decompressed image is not precisely the same as the
first.
Lossy Algorithm
Lossless Algorithm
Joint Photographic Experts Group (JPEG)
8X8 FDCT and IDCT
Quantization
Literature Survey
Vahid Bastani (2010) proposed an algorithm for image compression focused around an image
inpainting [29] system. Initially the image regions that can be precisely recuperated are located.
At that point, to lessen the information, data of such locales is evacuated. The remaining
information other than essential details for recovering the removed regions are encoded to
51
deliver output data. At the decoder, an inpainting method is applied to retrieve removed regions
using information extracted at the encoder. The image inpainting technique utilized partial
differential equations (PDEs) for recovering data. It is intended to accomplish superior
performance in terms of image compression criteria. This algorithm was analyzed for different
images. A high compression ratio of 1:40 was achieved at an acceptable quality. Trial results
demonstrated achievable obvious quality improvement at a high compression ratio compared
with JPEG. The PSNR and SSIM of the sample images demonstrated that the proposed
technique outperformed JPEG at high compression ratios, for example, 1:40 (0.2 bpp) and were
more outstandingin low structured and low textured pictures.
TC
.O
Qiang LI (2014), proposed a novel algorithm that uses compressed sensing (CS) [30] in the
frequency domain rather than most existing algorithms which are pixel based, to recreate
corrupted images. With a specific end goal to reconstruct image, the authors first disintegrated
the picture into two functions with diverse basic characteristics - structure component and textual
component. They looked for a meager representation for the functions and utilized the DCT
coefficients of this representation to produce an over-complete word dictionary. Experimental
results on real world datasets showed the adequacy of their method in image inpainting. The
method is contrasted with three state-of-the-art inpainting algorithms and it showed favorable
circumstances regarding both quantitative and qualitative aspects. The proposed system can
viably repair images contrasted with three other pixel-based image inpainting systems referred in
the paper, particularly when the image is met with a large destroyed region. The method ensured
good image quality with the structure being decently restored, and the PSNR is generally high.
Likewise, there is a much better advantage in terms of time spent.
IJ
other helpful data additionally enhanced the transmission efficiency and security in the
transmission process. The article combines JPEG compression algorithm with chaotic encryption
algorithm, which can viably save the storage space for image and guarantees the secure
transmission of image information. In this paper, the actual characteristics of DSP hardware
platform were taken into consideration. They utilized the static image compression algorithm to
compress image. Since DCT transform is the most lengthy part in the image processing, this
article is planned the FDCT transform and FIDCT transform systems
TC
.O
Mitchell A. Golner (2012) proposed a region based variable quantization scheme [24], where
the quantization granularity in diverse preselected regions of the image is varied at the discretion
of the user. The techniques developed in this work are compatible with the popular JPEG Still
Image Standard for compression of continuous-tone grey-scale and color images. Further, region
selection techniques and algorithms that complement variable quantization techniques are
introduced. The paper introduced three masks: step, linear interpolated, and raised cosine
interpolated, that control the transition in the quantization granularity between regions of diverse
compression ratios in an image.
incorporates a point by point discussion of simulation results utilizing the proposed
methodology. At the point when the strategies recommended were used, the subjective visual
quality significantly enhances for comparable compression ratios of standard JPEG
implementation, or proportionately, a higher compression ratio is accomplished for the same
subjective visual quality. Likewise, in conjunction with the variable quantization technique, they
introduced step, linear interpolated, and raised cosine interpolated masks that control the
quantization granularity in transitions between regions of different compression ratios.
IJ
We can write algorithms by considering this property, and use the mean of all the closest
neighbors to replace a damaged pixel. Hence a decent level of restoration is guaranteed by this
method. The algorithm proposed will complete an iterative methodology wherein the mean
intensity is discovered and further substitution The computation of the likelihood of event of
53
each one of noisy pixel is carried out. Consider an input picture Pi, given us a chance to
characterize a pixel at a position (q,r) in the info picture. Neighbor of Pi(q,r) is performed first.
The mean worth is acquired by utilizing the accompanying representation Eq. 1, for a sum of k
neighbors in that window.
Eq. 1 gives the mean of all neighboring points of a specific pixel. This gives a value what we call
as a "good pixel value". Hence the good pixel value replaces the central corrupt pixel. This
guarantees the removal of the tainted pixels and restoration of the given image.
TC
.O
4) Convert to Black and White (logical class) and save the positions of 1(luminance) from
the matrix.
IJ
6) Apply KNN Algorithm to the positions obtained from step 4, in the DCT Coefficients.
54
TC
.O
IJ
Reference
[1] Wallace, G. (Feb 1992). The JPEG Still Picture Compression Standard. Consumer
Electronics, IEEE Transactions, xviii - xxxiv .
[2] N. Ahmed, T. N. (Jan 1974). Discrete Cosine Transform. IEEE Trans. Commun. 23, 9093.
[3] M. Bertalmio, A. B. (2001). Navier-stokes, fluid dynamics, and image and video inpainting.
Proceedings of the 2001 IEEE Computer Society Conference on (Volume:1 ) (pp. I-355 - I-362
vol.1 ). IEEE.
[4] Telea, A. (2004). An image inpainting technique based on the fast marching method. J.
Graphics Tools, vol. 9, no. 1 , pp. 2536.
[5] Tschumperle, D. (2006, March 01). Fast anisotropic smoothing of multi-valued images using
curvature-preserving pdes. Springer , pp. 65-82.
[6] Shen, T. C. (2002). Mathematical Models for Local Nontexture Inpaintings. SIAM J.
Appl.Math, vol. 62, no. 3 , pp. 10191043.
[7] Leung, A. E. (1999). Texture synthesis by non-parametric sampling. Computer Vision, 1999.
The Proceedings of the Seventh IEEE International Conference on (Volume:2 ) (pp. 1033 - 1038
vol.2 ). Kerkyra: IEEE.
[8] A. Criminisi, P. P. (Sept 2004). Region filling and object removal by examplar-based
inpainting. IEEE Trans. on Image Processing, vol. 13, no. 9, 1200 1212.
55