Image Processing Lab Section 28/3/2016 Prepared by Mahmoud Abdelsatar Demonstrator at IT Dep. Faculty of computers and information Assuit University.

Slides:



Advertisements
Similar presentations
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Spatial Filtering (Chapter 3)
Image Processing Lecture 4
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Spatial Filtering.
Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level.
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing
Digital Image Processing
E.G.M. PetrakisFiltering1 Linear Systems Many image processing (filtering) operations are modeled as a linear system Linear System δ(x,y) h(x,y)
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Chapter 3: Image Enhancement in the Spatial Domain
Rank filtering From noise image Rank filtering mask (7 x 7 ) rank 4.
Image Enhancement To process an image so that the result is more suitable than the original image for a specific application. Spatial domain methods and.
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
2007Theo Schouten1 Enhancements Techniques for editing an image such that it is more suitable for a specific application than the original image. Spatial.
Digital Image Processing
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Lecture 2. Intensity Transformation and Spatial Filtering
Chapter 3 Image Enhancement in the Spatial Domain.
Chapter 5 Image Restoration. Preview Goal: improve an image in some predefined sense. Image enhancement: subjective process Image restoration: objective.
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
Chapter 3 (cont).  In this section several basic concepts are introduced underlying the use of spatial filters for image processing.  Mainly spatial.
Chapter 3: Image Enhancement in the Spatial Domain
Chap2 Image enhancement (Spatial domain)
Chapter 10: Image Segmentation
Presentation Image Filters
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
Chapter 5 Image Restoration.
Digital Image Processing Image Enhancement Part IV.
DIGITAL IMAGE PROCESSING Instructors: Dr J. Shanbehzadeh M.Gholizadeh M.Gholizadeh
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image processing Fourth lecture Image Restoration Image Restoration: Image restoration methods are used to improve the appearance of an image.
Image Restoration Chapter 5.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods  Process an image so that the result will be more suitable.
Lecture 5 Mask/Filter Transformation 1.The concept of mask/filters 2.Mathematical model of filtering Correlation, convolution 3.Smoother filters 4.Filter.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Digital Image Processing Lecture 10: Image Restoration
Spatial Filtering.
Ch5 Image Restoration CS446 Instructor: Nada ALZaben.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Image Subtraction Mask mode radiography h(x,y) is the mask.
COMP322/S2000/L171 Robot Vision System Major Phases in Robot Vision Systems: A. Data (image) acquisition –Illumination, i.e. lighting consideration –Lenses,
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
Chapter 5 Image Restoration.
Image enhancement Last update Heejune Ahn, SeoulTech.
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Fundamentals of Spatial Filtering:
ECE 692 – Advanced Topics in Computer Vision
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
Digital Image Processing
Image Enhancement in the Spatial Domain
Digital Image Processing
Digital Image Processing Week IV
Image Enhancement in the Spatial Domain
Fundamentals of Spatial Filtering
Presentation transcript:

Image Processing Lab Section 28/3/2016 Prepared by Mahmoud Abdelsatar Demonstrator at IT Dep. Faculty of computers and information Assuit University

Topics Spatial Filtering Linear Filtering Nonlinear Filtering Enhancement using Arithmetic/Logic Operations

Spatial filtering use filter (can also be called as mask/kernel/template or window) the values in a filter subimage are referred to as coefficients, rather than pixel. our focus will be on masks of odd sizes, e.g. 3x3, 5x5, …

Spatial Filtering Process simply move the filter mask from point to point in an image. at each point (x,y), the response of the filter at that point is calculated using a predefined relationship.

Linear Filtering Linear Filtering of an image f of size MxN filter mask of size mxn is given by the expression where a = (m-1)/2 and b = (n-1)/2 To generate a complete filtered image this equation must be applied for x = 0, 1, 2, …, M-1 and y = 0, 1, 2, …, N-1

Smoothing Spatial Filters used for blurring and for noise reduction blurring is used in preprocessing steps, such as ▫removal of small details from an image prior to object extraction ▫bridging of small gaps in lines or curves noise reduction can be accomplished by blurring with a linear filter and also by a nonlinear filter

Smoothing Linear Filters replacing the value of every pixel in an image by the average of the gray levels in the neighborhood will reduce the “ sharp ” transitions in gray levels. sharp transitions ▫random noise in the image ▫edges of objects in the image thus, smoothing can reduce noises (desirable) and blur edges (undesirable)

3x3 Smoothing Linear Filters box filterweighted average the center is the most important and other pixels are inversely weighted as a function of their distance from the center of the mask

General form : smoothing mask filter of size mxn (m and n odd) summation of all coefficient of the mask

Example a). original image 500x500 pixel b). - f). results of smoothing with square averaging filter masks of size n = 3, 5, 9, 15 and 25, respectively. Note: ▫big mask is used to eliminate small objects from an image. ▫the size of the mask establishes the relative size of the objects that will be blended with the background.

Example we can see that the result after smoothing and thresholding, the remains are the largest and brightest objects in the image. original imageresult after smoothing with 15x15 averaging mask result of thresholding

Example Apply average filtering on the image f given that the size of the mask(window) is 3x3 and image pixels have the gray values in the range [0,7] /9 Image Mask

Example Apply average filtering on the image f given that the size of the mask(window) is 3x3 and image pixels have the gray values in the range [0,7].The mask is weighted and its value as shown in the mask matrix /162/16 1/16 2/164/162/16 1/162/161/16 Image Mask

14 Order-Statistics Filters (Nonlinear Filters) the response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter example ▫median filter : R = median{z k |k = 1,2, …,n x n} ▫max filter : R = max{z k |k = 1,2, …,n x n} ▫min filter : R = min{z k |k = 1,2, …,n x n} note: n x n is the size of the mask

15 Median Filters replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel (the original value of the pixel is included in the computation of the median) impulse noise  salt and pepper noise provide excellent noise-reduction capabilitiesless blurring than linear smoothing filters of similar size.quite popular because for certain types of random noise (impulse noise  salt and pepper noise), they provide excellent noise-reduction capabilities, with considering less blurring than linear smoothing filters of similar size.

Median Filters forces the points with distinct gray levels to be more like their neighbors. isolated clusters of pixels that are light or dark with respect to their neighbors, and whose area is less than n 2 /2 (one-half the filter area), are eliminated by an n x n median filter. eliminated = forced to have the value equal the median intensity of the neighbors. larger clusters are affected considerably less

Example : Median Filters

Example Apply median filtering on the image f given that the size of the mask(window) is 3x3 and image pixels have the gray values in the range [0,7] Image Mask

Example Apply min filtering on the image f given that the size of the mask(window) is 3x3 and image pixels have the gray values in the range [0,7] Image Mask

Example Apply max filtering on the image f given that the size of the mask(window) is 3x3 and image pixels have the gray values in the range [0,7] Image Mask

Linear Filtering Using Matlab Linear filtering in matlab accomplished in two steps: 1-Create the appropriate mask( W). 2-Aplly the linear filtering by mask W using the imfilter function. Imfilter function syntax imfilter(image, w, filtering_mode,boundry_option,size_option);

Filtering Mode: Correlation or Convolution  ‘corr’  Correlation.(default)  ‘conv’  Convultion. Boundy Option:  value P.  ‘replicate’.  ‘symmetric’.  ‘circular’. Size Option:  ‘full’.  ‘same’.  (default).

Average filtering >>W=ones(3); >>w=w./9; >>f=imread(‘cameraman.tif’); >>g2=imfilter(f,w);

Enhancement using Arithmetic/Logic Operations Arithmetic/Logic operations perform on pixel by pixel basis between two or more images except NOT operation which perform only on a single image

25

26 Logic Operations Logic operation performs on gray-level images, the pixel values are processed as binary numbers light represents a binary 1, and dark represents a binary 0 NOT operation = negative transformation

27 Example of AND Operation original imageAND image mask result of AND operation

28 Example of OR Operation original imageOR image mask result of OR operation

29 Image Subtraction g(x,y) = f(x,y) – h(x,y) enhancement of the differences between images