Image processing - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Image processing

Description:

Image processing Enhancement and restoration Image Histogram is a chart that shows the distribution of intensities in an indexed or intensity image. – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 18
Provided by: eeUnlvEd8
Learn more at: http://www.ee.unlv.edu
Category:

less

Transcript and Presenter's Notes

Title: Image processing


1
Image processing
  • Enhancement and restoration

2
Image Histogram
  • is a chart that shows the distribution of
    intensities in an indexed or intensity image.
  • The image histogram function imhist creates this
    plot by making n equally spaced bins, each
    representing a range of data values. It then
    calculates the number of pixels within each range.

3
Histogram of stars and Pout
  • I imread('ngc4024l.tif')
  • figure, imhist(I,255)
  • I imread(pout.tif')
  • figure, imhist(I,255)

4
Histogram equalization
  • Let H(p) be the input histogram and that
    the input gray-scale is po, pk
  • The intention is to find a monotonic pixel
    brightness qT(p) such that the output
    histogram G(q) is uniform over the whole output
    brightness scale qo, qk
  • The histogram is a discrete probability density
    function.
  • The monotonic property of the transform T implies

5
Histogram equalization
  • The aim is to produce an image with equally
    distributed brightness levels over the whole
    brightness scale.

6
Histogram equalization
  • Assume image of MxN pixels
  • The equalized histogram corresponding to the
    uniform probability density function f whose
    function value is a constant
  • The equalized histogram can be obtained precisely
    only for the idealized'' continuous probability
    density, in which case the sum equation becomes

7
Histogram equalization
  • The desired pixel brightness transformation T can
    then be derived as
  • The integral in the above equation is called the
    cumulative histogram, which is approximated by a
    sum for digital images.

8
Histogram equalization
  • So the resulting histogram is not equalized
    ideally.
  • The discrete approximation of the continuous
    pixel brightness transformation form the above
    equation is

9
Histogram equalization
  • I imread('pout.tif')
  • J histeq(I)
  • imshow(I)
  • figure, imshow(J)

10
filter2 and imfilter for image filtering.
  • filter2(h,A) filters the data in A with the
    two-dimensional filter in the matrix h.
  • A filter is to be specified by matrix h with
    fspecial.
  • h fspecial(type)
  • h fspecial(type,parameters)
  • Imfilter is for multidimensional image filtering
  • B imfilter(A,H)
  • B imfilter(A,H,option1,option2,...)
  • Filter Options
  • 'corr imfilter performs multidimensional
    filtering using correlation, which is the same
    way that filter2 performs filtering. When no
    correlation or convolution option is specified,
    imfilter uses correlation.
  • 'conv imfilter performs multidimensional
    filtering using convolution.

11
fspecial
  • h fspecial(type)
  • h fspecial(type,parameters)
  • h fspecial(type) creates a two-dimensional
    filter, h, of the specified type.
  • fspecial returns h as a correlation kernel, which
    is the appropriate form to use with imfilter.
    type is a string having one of these values
  • 'gaussian' for a Gaussian lowpass filter
  • 'sobel' for a Sobel horizontal edge-emphasizing
    filter
  • 'prewitt' for a Prewitt horizontal
    edge-emphasizing filter
  • 'laplacian' for a filter approximating the
    two-dimensional Laplacian operator
  • 'log' for a Laplacian of Gaussian filter
  • 'average' for an averaging filter
  • 'unsharp' for an unsharp contrast enhancement
    filter

12
Average and Median filter
  • For example, for averaging filter for the window
    of size of 3x3, the filtered image K is obtained
    as
  • K filter2(fspecial('average',3),I)/255
  • Median filter
  • L medfilt2(I,3 3)

13
Noise removal
  • IMNOISE function add a noise to image.
  • J IMNOISE(I,TYPE,...) Add noise of a given TYPE
    to the intensity image I. TYPE is a string that
    can have one of these values
  • 'gaussian' Gaussian white noise with
    constant mean and variance
  • 'localvar' Zero-mean Gaussian white noise
    with an intensity-dependent variance
  • 'poisson' Poisson noise
  • 'salt pepper' "On and Off" pixels
  • 'speckle' Multiplicative noise

14
Add noise
  • I imread(pout.tif')
  • J imnoise(I,'gaussian')
  • figure, imshow(J)

15
Filtering a Region
  • specify a region using roipoly function. If you
    call roipoly with no input arguments, the cursor
    changes to a cross hair when it is over the image
    displayed in the current axes. You can then
    specify the vertices of the polygon by clicking
    on points in the image with the mouse.
    Doubleclick to finish.
  • I imread('pout.tif')
  • imshow(I)
  • BW roipoly
  • imshow(BW)

16
roifilt2
  • use the roifilt2 function to process a region of
    interest.
  • When you call roifilt2, you specify an intensity
    image, a binary mask, and a filter.
  • roifilt2 filters the input image and returns an
    image that consists of filtered values for pixels
    where the binary mask contains 1's, and
    unfiltered values for pixels where the binary
    mask contains 0's.
  • This type of operation is called masked
    filtering.

17
Region of interest filtering
  • h fspecial('unsharp')
  • I2 roifilt2(h,I,BW)
  • figure, imshow(I2)
Write a Comment
User Comments (0)
About PowerShow.com