Wednesday, April 3, 2013

sharpening and smoothing

research.stowers-institute.org/efg/Report/FourierAnalysis.pdf


http://fourier.eng.hmc.edu/e161/lectures/gradient/node5.html
http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm
http://www.cambridgeincolour.com/tutorials/image-sharpening.htm


https://www.google.co.in/search?hl=en&newwindow=1&q=image+sharpening+and+smoothing&oq=sharpening+and+smoothing&gs_l=serp.1.1.0i22i30l5.3624049.3630132.0.3635406.47.18.0.0.0.10.482.1504.11j3j4-1.15.0...0.0...1c.1.7.serp.xoTJwvsI_so

 
 
From taking better pictures on a camera to improved medical diagnostics, imaging applications touch every aspect of daily life. The common thread between all these applications is the requirement to capture data from a sensor and process it at high speed to handle the large volume of data produced by sensors as well as to provide superb user experience in devices such as cameras.
Synphony allows the capture and design of hardware implementations of imaging algorithms in C, the same untimed language commonly used during algorithm development and exploration. By taking care of the complex task of extracting parallelism and creating high performance hardware,the Synphony allows the designer to focus on the key differentiator – the algorithm and the overall architecture to achieve the final image look that will captivate customers.
Typical Imaging Designs synopsys
The Synphony team has successfully worked with designers to complete a wide variety of complex imaging applications with excellent quality of results. Example designs that have been done or can be done using Synphony C Compiler includes:
  • Image capture: Bayer to RGB conversion, color space conversion, sharpening and smoothing, smile and face detection and red-eye reduction
  • Medical imaging: Algorithms like back-projection and FFT/IFFT Compression/Decompression: Commonly used algorithms in compression such as DCT/IDCT, wavelet coding, Huffman coding; JPEG, JPEG2000 and lossless JPEG pipelines
  • Image processing and enhancements: Scaling, sharpening, noise reduction, edge smoothing, background/foreground separation and film grain insertion
  • Image analysis for security, automotive, medical and industrial applications: Edge detection, face recognition, feature detection, lane/sign detection and object recognition
  • Printer pipelines: Color transform, halftoning, scaling, compression/decompression of halftoned images and resolution enhancement

ompass Gradient Operations

The following compass operators can detect edges of a particular direction:
\begin{displaymath}\left[ \begin{array}{rrr} -1 & 0 & 1  -1 & 0 & 1  -1 & 0 ...
...& 0  1 & 0 & -1  0 & -1 & -1
\end{array} \right], \;\;\;
\end{displaymath}


\begin{displaymath}\left[ \begin{array}{rrr} 1 & 0 & -1  1 & 0 & -1  1 & 0 &...
...} -1 & -1 & 0  -1 & 0 & 1  0 & 1 & 1
\end{array} \right]
\end{displaymath}

Other compass operators
\begin{displaymath}
\left[ \begin{array}{rrr} 1 & 1 & 1  1 & -2 & 1  -1 & -...
...& 1  0 & 0 & 0  -1 & -2 & -1
\end{array} \right], \;\;\;
\end{displaymath}

For all convolution kernels above, the sum of all elements is zero, i.e., the output from a homogeneous image region is zero. If the orientation of the edge is not needed, we run these compass operators in all directions and find if the maximum of them is greater than a threshold value. edge_detection_4_dir.gif
Higher angular resolution can be achieved by increase the mask size. The two kernels below are for 30 and 60 degrees, respectively:
\begin{displaymath}
\left[ \begin{array}{rrrrr} 1 & 1 & 1 & 1 & 1  -.32 & .78 ...
...2 & .78 & 1 \\
-1 & -1 & -1 & -.32 & 1
\end{array} \right]
\end{displaymath}





home left right up

---

Laplacian/Laplacian of Gaussian


Common Names: Laplacian, Laplacian of Gaussian, LoG, Marr Filter

Brief Description

The Laplacian is a 2-D isotropic measure of the 2nd spatial derivative of an image. The Laplacian of an image highlights regions of rapid intensity change and is therefore often used for edge detection (see zero crossing edge detectors). The Laplacian is often applied to an image that has first been smoothed with something approximating a Gaussian smoothing filter in order to reduce its sensitivity to noise, and hence the two variants will be described together here. The operator normally takes a single graylevel image as input and produces another graylevel image as output.

How It Works

The Laplacian L(x,y) of an image with pixel intensity values I(x,y) is given by:
Eqn:eqnlog1
This can be calculated using a convolution filter.
Since the input image is represented as a set of discrete pixels, we have to find a discrete convolution kernel that can approximate the second derivatives in the definition of the Laplacian. Two commonly used small kernels are shown in Figure 1.




Figure 1 Two commonly used discrete approximations to the Laplacian filter. (Note, we have defined the Laplacian using a negative peak because this is more common; however, it is equally valid to use the opposite sign convention.)

Using one of these kernels, the Laplacian can be calculated using standard convolution methods.
Because these kernels are approximating a second derivative measurement on the image, they are very sensitive to noise. To counter this, the image is often Gaussian smoothed before applying the Laplacian filter. This pre-processing step reduces the high frequency noise components prior to the differentiation step.
In fact, since the convolution operation is associative, we can convolve the Gaussian smoothing filter with the Laplacian filter first of all, and then convolve this hybrid filter with the image to achieve the required result. Doing things this way has two advantages:
  • Since both the Gaussian and the Laplacian kernels are usually much smaller than the image, this method usually requires far fewer arithmetic operations.
  • The LoG (`Laplacian of Gaussian') kernel can be precalculated in advance so only one convolution needs to be performed at run-time on the image.
The 2-D LoG function centered on zero and with Gaussian standard deviation Eqn:eqnsigma has the form:
Eqn:eqnlog2
and is shown in Figure 2.




Figure 2 The 2-D Laplacian of Gaussian (LoG) function. The x and y axes are marked in standard deviations (Eqn:eqnsigma).

A discrete kernel that approximates this function (for a Gaussian Eqn:eqnsigma = 1.4) is shown in Figure 3.




Figure 3 Discrete approximation to LoG function with Gaussian Eqn:eqnsigma = 1.4

Note that as the Gaussian is made increasingly narrow, the LoG kernel becomes the same as the simple Laplacian kernels shown in Figure 1. This is because smoothing with a very narrow Gaussian (Eqn:eqnsigma < 0.5 pixels) on a discrete grid has no effect. Hence on a discrete grid, the simple Laplacian can be seen as a limiting case of the LoG for narrow Gaussians.

Guidelines for Use

The LoG operator calculates the second spatial derivative of an image. This means that in areas where the image has a constant intensity (i.e. where the intensity gradient is zero), the LoG response will be zero. In the vicinity of a change in intensity, however, the LoG response will be positive on the darker side, and negative on the lighter side. This means that at a reasonably sharp edge between two regions of uniform but different intensities, the LoG response will be:
  • zero at a long distance from the edge,
  • positive just to one side of the edge,
  • negative just to the other side of the edge,
  • zero at some point in between, on the edge itself.
Figure 4 illustrates the response of the LoG to a step edge.




Figure 4 Response of 1-D LoG filter to a step edge. The left hand graph shows a 1-D image, 200 pixels long, containing a step edge. The right hand graph shows the response of a 1-D LoG filter with Gaussian Eqn:eqnsigma = 3 pixels.

By itself, the effect of the filter is to highlight edges in an image.
For example,
wdg4
is a simple image with strong edges.
The image
wdg4log1
is the result of applying a LoG filter with Gaussian Eqn:eqnsigma = 1.0. A 7×7 kernel was used. Note that the output contains negative and non-integer values, so for display purposes the image has been normalized to the range 0 - 255.
If a portion of the filtered, or gradient, image is added to the original image, then the result will be to make any edges in the original image much sharper and give them more contrast. This is commonly used as an enhancement technique in remote sensing applications.
To see this we start with
fce2
which is a slightly blurry image of a face.
The image
fce2log1
is the effect of applying an LoG filter with Gaussian Eqn:eqnsigma = 1.0, again using a 7×7 kernel.
Finally,
fce2log2
is the result of combining (i.e. subtracting) the filtered image and the original image. Note that the filtered image had to be suitable scaled before combining in order to produce a sensible enhancement. Also, it may be necessary to translate the filtered image by half the width of the convolution kernel in both the x and y directions in order to register the images correctly.
The enhancement has made edges sharper but has also increased the effect of noise. If we simply filter the image with a Laplacian (i.e. use a LoG filter with a very narrow Gaussian) we obtain
fce2lap2
Performing edge enhancement using this sharpening image yields the noisy result
fce2lap1
(Note that unsharp filtering may produce an equivalent result since it can be defined by adding the negative Laplacian image (or any suitable edge image) onto the original.) Conversely, widening the Gaussian smoothing component of the operator can reduce some of this noise, but, at the same time, the enhancement effect becomes less pronounced.
The fact that the output of the filter passes through zero at edges can be used to detect those edges. See the section on zero crossing edge detection.
Note that since the LoG is an isotropic filter, it is not possible to directly extract edge orientation information from the LoG output in the same way that it is for other edge detectors such as the Roberts Cross and Sobel operators.
Convolving with a kernel such as the one shown in Figure 3 can very easily produce output pixel values that are much larger than any of the input pixels values, and which may be negative. Therefore it is important to use an image type (e.g. floating point) that supports negative numbers and a large range in order to avoid overflow or saturation. The kernel can also be scaled down by a constant factor in order to reduce the range of output values.

Common Variants

It is possible to approximate the LoG filter with a filter that is just the difference of two differently sized Gaussians. Such a filter is known as a DoG filter (short for `Difference of Gaussians').
As an aside it has been suggested (Marr 1982) that LoG filters (actually DoG filters) are important in biological visual processing.
An even cruder approximation to the LoG (but much faster to compute) is the DoB filter (`Difference of Boxes'). This is simply the difference between two mean filters of different sizes. It produces a kind of squared-off approximate version of the LoG.

Interactive Experimentation

You can interactively experiment with the Laplacian operator by clicking here.
You can interactively experiment with the Laplacian of Gaussian operator by clicking here.

Exercises

  1. Try the effect of LoG filters using different width Gaussians on the image
    ben2
    What is the general effect of increasing the Gaussian width? Notice particularly the effect on features of different sizes and thicknesses.
  2. Construct a LoG filter where the kernel size is much too small for the chosen Gaussian width (i.e. the LoG becomes truncated). What is the effect on the output? In particular what do you notice about the LoG output in different regions each of uniform but different intensities?
  3. Devise a rule to determine how big an LoG kernel should be made in relation to the Eqn:eqnsigma of the underlying Gaussian if severe truncation is to be avoided.
  4. If you were asked to construct an edge detector that simply looked for peaks (both positive and negative) in the output from an LoG filter, what would such a detector produce as output from a single step edge?

References

R. Haralick and L. Shapiro Computer and Robot Vision, Vol. 1, Addison-Wesley Publishing Company, 1992, pp 346 - 351.
B. Horn Robot Vision, MIT Press, 1986, Chap. 8.
D. Marr Vision, Freeman, 1982, Chap. 2, pp 54 - 78.
D. Vernon Machine Vision, Prentice-Hall, 1991, pp 98 - 99, 214.

Local Information

Specific information about this operator may be found here.
More general advice about the local HIPR installation is available in the Local Information introductory section.

---

home left right up

©2003 R. Fisher, S. Perkins, A. Walker and E. Wolfart.

Valid HTML 4.0!



No comments:

Post a Comment