Second Review

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

EXISTING SYSTEM

 Statistical-based methods,
 PDE-based methods,
 Exemplar-based methods.

Statistical - based methods

These methods are mainly used for the case of texture synthesis. Typically, what these
methods do is that, given an input texture, they try to describe it by extracting some statistics
through the use of compact parametric statistical models.

Then, in order to synthesize a new texture, these methods typically start with an output
image containing pure noise, and keep perturbing that image until its statistics match the
estimated statistics of the input texture.

Besides the synthesis of still images, parametric statistical models have been also
proposed for the case of image sequences.

However, the main drawback of all methods that are based on parametric statistical
models is that, as already mentioned, they are applicable only to the problem of texture synthesis,
and not to the general problem of image completion.

PDE - based methods

These methods, on the other hand, try to fill the missing region of an image through a
diffusion process, by smoothly propagating information from the boundary towards the interior
of the missing region.
According to these techniques, the diffusion process is simulated by solving a partial
differential equation (PDE), which is typically non-linear and of high order.

The main disadvantage of almost all PDE based methods is that they are mostly suitable
for image inpainting situations. This term usually refer to the case where the missing part of the
image consists of thin, elongated regions.

Furthermore, PDE-based methods implicitly assume that the content of the missing
region is smooth and non-textured.

For this reason, when these methods are applied to images where the missing regions are
large and textured, they usually oversmooth the image and introduce blurring artifacts.

Exemplar-based methods

These methods try to fill the unknown region simply by copying content from the
observed part of the image. All exemplar-based techniques for texture synthesis that have
appeared until now, were either pixel-based , or patch-based, meaning that the final texture was
synthesized one pixel, or one patch at a time by simply copying pixels or patches from the
observed image respectively.

Exemplar based method


Recent exemplar-based methods also place emphasis on the order by which the image
synthesis proceeds, usually using a confidence map for this purpose. There are two main
handicaps of related existing techniques.

First, the confidence map is computed based on heuristics and ad hoc principles that may
not apply in the general case and second, once an observed patch has been assigned to a missing
block of pixels, that block cannot change its assigned patch thereafter.

This last fact reveals the greediness of these techniques, which may lead to visual
inconsistencies.

PROPOSED SYSTEM

We presenting an operator called seam carving for content-aware resizing of images


computed as the optimal paths on a single image and removing from an image.

This operator can be used for image manipulations including: image retargeting and
object removal. The operator can be easily integrated with various saliency measures, as well as
user input, to guide the resizing process.

In addition, we define a data structure for multi-size images that support continuous
resizing ability in real time we present a representation of multi-size images that encodes, for an
image of size (m×n), an entire range of retargeting sizes from a×b to m×n and allows the user to
retarget an image continuously in real time.

Seam carving

Seam carving is an image resizing algorithm developed by Shai Avidan and Ariel
Shamir. This algorithm alters the dimensions of an image not by scaling or cropping, but rather
by intelligently removing pixels from (or adding pixels to) the image that carry little importance.
The importance of a pixel is generally measured by its contrast when compared with its
neighbor pixels, but other measures may be used. Additionally, it's possible to define (or
autodetect) areas of high importance (faces, buildings, etc.) in which pixels may not be deleted,
and conversely, areas of zero importance which should be removed first.

From this information, the algorithm detects seams (continuous lines of pixels joining
opposite edges of the image) which have the lowest importance, and deletes those.

This shrinks the image by one horizontal or vertical line, depending on which direction
the seam ran. Seam carving can also be run in reverse by adding interpolated pixels along the
lowest energy seam.

With this technique, it's now possible to reduce or enlarge pictures by a wide range, while
still retaining details. In normal image scaling, it's often not possible to scale about factor greater
than 2 or less than 0.5, without losing much of the images quality.

ADVANTAGES OF PROPOSED SYSTEM

We here propose the image completion process with a handful of advantages providing
an image with visually plausible outcome without any inconsistencies, thereby providing the
necessary image enlarging.

A simple image operator called seam carving is used here that supports content-aware
image resizing for both reduction and expansion. A seam is an optimal 8-connected path of
pixels on a single image from top to bottom, or left to right, where optimality is defined by an
image energy function.

No user intervention is required by our method, which avoids greedy patch assignments
by maintaining many candidate source patches. In this way, each missing block of pixels is
allowed to change its assigned patch many times throughout the execution of the algorithm, and
is not enforced to remain tied to the first label that has been assigned to it during the early stages
of the completion process.
Our formulation applies not only to image completion, but also to texture synthesis and
image inpainting, thus providing a unified framework for all of these tasks.

To this end, a novel optimization scheme is proposed, the “Priority-BP” algorithm, which
carries 2 major improvements over standard belief propagation: “dynamic label pruning” and
“priority based message scheduling”.

Together, they bring a dramatic reduction in the overall computational cost of BP. It is to
be noted that both extensions are generic and can be used for the optimization of any MRF.

MODULE DESCRIPTION

1. DESIGN AND LOADING IMAGE

In this module we are designing the screen and image viewer. Next we load the binary
image in order to display the image that demands pruning and image resizing.

2 TOOLS AND ADJUSTING THE IMAGE

The arrow keys on the keyboard are used to increase or decrease the width and height of
the image. The window with the picture must be the active window on screen for pressing the
arrow keys to work. And also to see the adjustment in the screen while resizing the image.

(i)Tools

Certain tools are central to the processing of digital images. These include mathematical
tools such as convolution, Fourier analysis, and statistical descriptions, and manipulative tools
such as chain codes and run codes.

(ii)Convolution
In image processing applications, the entire input function is often available for comput-
ing every sample of the output function. In that case, the constraint that each output is the effect
of only prior inputs can be relaxed. Convolution amplifies or attenuates each frequency compo-
nent of the input independently of the other components.

(iii)Fourier Analysis

Fourier analysis is a subject area which grew out of the study of Fourier series. The sub-
ject began with trying to understand when it was possible to represent general functions by sums
of simpler trigonometric functions.

The attempt to understand functions (or other objects) by breaking them into basic pieces
that are easier to understand is one of the central themes in Fourier analysis. Fourier analysis is
named after Joseph Fourier who showed that representing a function by a trigonometric series
greatly simplified the study of heat propagation.

3. FILTERING

Here we are filtering the image to avoid noise by three algorithms. They are:
 Sobel filter
 Prewitt filter
 Laplace filter

(i)Sobel Filter

The Sobel operator performs a 2-D spatial gradient measurement on an image and so
emphasizes regions of high spatial frequency that correspond to edges. Typically it is used to
find the approximate absolute gradient magnitude at each point in an input grayscale image.
The Sobel Edge filter is use to detect edges based applying a horizontal and vertical filter
in sequence. Both filters are applied to the image and summed to form the final result. The two
filters are basic convolution filters of the form:

Vertical Filter Horizontal Filter

1 2 1
0 0 0
-1 -2 -1
-1 0 1
-2 0 2
-1 0 1

Fig 3.1 Interface of sobel filter


Fig 3.2 E-R diagram of sobel filter

(ii)Prewitt Filter

The Prewitt Edge filter is use to detect edges based applying a horizontal and vertical
filter in sequence. Both filters are applied to the image and summed to form the final result. The
two filters are basic convolution filters of the form:

Horizontal Filter Vertical Filter


1 1 1 -1 0 1
0 0 0 -1 0 1
-1 -1 -1 -1 0 1
Fig 3.3 E-R diagram of prewitt filter

(iii) Laplace Filter

Discrete laplace operator is often used in image processing e.g. in edge detection and
motion estimation applications. The discrete laplacian is defined as the sum of the second
derivatives Laplace operator#Coordinate expressions and calculated as sum of differences over
the nearest neighbours of the central pixel.

Implementation in Image Processing


For one, two and three dimensional signals, the discrete laplacian can be given as
convolution with the following kernels:

1D-Filter:
2D-Filter:

or, including the diagonals:

2D-Filter:

3D-Filter: is given by: first plane = ;

second plane = ; third plane =

These kernels are deduced by using discrete differential quotients


Fig 3.4 E-R diagram of laplace filter

4. PRUNING
Pruning is mainly done under Priority-BP algorithm with forward pass and backward
pass by labeling the node which to be scheduled. The actual message scheduling mechanism as
well as label pruning takes place during the forward pass. The role of the backward pass is then
just to ensure that the other half of the messages gets transmitted as well.

(i).Label pruning

The main idea of “label pruning” is that, as we are visiting the nodes of the MRF during
the forward pass, we dynamically reduce the number of possible labels for each node by discard -
ing labels that are unlikely to be assigned to that node. Its use is allowed only in conjunction with
our priority-based message scheduling scheme of visiting most confident
nodes first.

This keeps our method generic and, therefore, applicable to any energy function. A key
observation, however, relates to the fact that label pruning is a technique not meant to be used on
its own.

(ii)Message scheduling

We use a specific message scheduling scheme, whose goal will be twofold. On one hand,
it will make label pruning possible and favor the
circulation of cheap messages. On the other hand, it will speed up BP’s convergence. This issue
of BP message scheduling, although known to be crucial for the success of BP, it has been
largely overlooked until now.

(iii)Forward Pass

Each iteration of Priority-BP is divided into a forward and a backward pass. The actual
message scheduling mechanism as well as label pruning takes place during the forward pass.
This is also where one half of the messages gets transmitted. To this end, all nodes are visited in
order of priority. Each time we visit a node, say p, we mark it as “committed” meaning that we
must not visit him again during the current forward pass.

We also prune its labels and then allow him to transmit its “cheap” (due to pruning) mes-
sages to all of its neighbors apart from the committed ones. The priorities of all neighbors that re-
ceived a new message are then updated and the process continues with the next uncommitted ( i.e
unvisited) node of highest priority until no more uncommitted nodes exist.

(iv)Backward Pass

The role of the backward pass is then just to ensure that the other half of the messages
gets transmitted as well. To this end, we do not make use of priorities but simply visit the nodes
in reverse order, with respect to the order of the forward pass and just transmit the remaining un-
sent messages from each node. For this reason, no label pruning takes place during this pass.

We do update node priorities, though, so that they are available during the next forward
pass. Also, as we shall see, a node’s priority depends only on the current beliefs at that node. One
big advantage out of this is that keeping the node priorities up-to-date can be done very effi -
ciently in this
case, since only priorities for nodes with newly received messages need to be updated.

(v)Types of neighborhoods

Neighborhood operations play a key role in modern digital image processing. It is


therefore important to understand how images can be sampled and how that relates to the various
neighborhoods that can be used to process an image.
 Rectangular sampling
In most cases, images are sampled by laying a rectangular grid over an
image. This results in the type of sampling shown in Figure a and b.
 Hexagonal sampling
An alternative sampling scheme is shown in Figure c and is termed hexagonal
sampling.

Local operations produce an output pixel value b [m=mo,n=no] based upon the pixel val-
ues in the neighborhood of a[m=mo,n=no]. Some of the most common neighborhoods are the 4-
connected neighborhood and the 8-connected neighborhood in the case of rectangular sampling
and the 6-connected neighborhood in the case of hexagonal sampling illustrated in Figure that
follows.

Fig 3.5 Sampling types


5. INTEGRATING RESIZER AND FILTER

Here we integrate the three filter algorithms with the seam carving image resizing
algorithm and saving the image in to the resized image. After integrating the resizer and filter we
are testing and implementing.
SYSTEM FLOW DIAGRAM

Input Image (100%) Tools and Adjust the


Image Sobel

Prewitt

Laplace
Img Resize

Forward Pass Backward Pass Img <100% Pruning

Belief Propagation

Seam carving 100% Output Image


SCREEN SHOTS

You might also like