SCCS 4761 Point Processing Basic Image Processing Operations Arithmetic Operations Histograms.

Slides:



Advertisements
Similar presentations
Laboratory of Image Processing Pier Luigi Mazzeo
Advertisements

Image Display MATLAB functions for displaying image Bit Planes
Digital Image Processing
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
Chapter - 2 IMAGE ENHANCEMENT
Intensity Transformations (Chapter 3)
6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in.
Image Enhancement in the Spatial Domain
1 Chapter 4: Point Processing 4.1 Introduction Any image-processing operation transforms the gray values of the pixels. Image-processing operations may.
Intensity Transformations
Digital Image Processing
Image Processing. Processing Digital Images digital images are often processed using “digital filters” digital filters are based on mathematical functions.
Chapter 4: Image Enhancement
BYST Eh-1 DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Image Enhancement.
Image Enhancement by Modifying Gray Scale of Individual Pixels
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Lecture 4 Digital Image Enhancement
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
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.
Digital Image Processing
CS 376b Introduction to Computer Vision 02 / 25 / 2008 Instructor: Michael Eckmann.
Image Enhancement.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Lecture 2. Intensity Transformation and Spatial Filtering
Lecture 4 Digital Image Enhancement
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Digital Image Processing Contrast Enhancement: Part I
Image Processing Image Histogram Lecture
Point Operations – Chapter 5. Definition Some of the things we do to an image involve performing the same operation on each and every pixel (point) –We.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
CIS 601 Image ENHANCEMENT in the SPATIAL DOMAIN Dr. Rolf Lakaemper.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Intensity Transformations or Translation in Spatial Domain.
infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images.
CS654: Digital Image Analysis Lecture 18: Image Enhancement in Spatial Domain (Histogram)
Digital Image Processing Lecture9: Intensity (Gray-level) Transformation Functions using MATLAB.
Image Enhancement in the Spatial Domain (MATLAB)
CIS 601 – 04 Image ENHANCEMENT in the SPATIAL DOMAIN Longin Jan Latecki Based on Slides by Dr. Rolf Lakaemper.
Digital Image Processing EEE415 Lecture 3
Prepared by: Hanan Hardan
CH2. Point Processes Arithmetic Operation Histogram Equalization
Digital Image Processing Part 2 Contrast processing.
Digital Image Processing
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
M ATLAB L ECTURE 2 Image Enhancement in the Spatial Domain (MATLAB)
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
Digital Image Processing Image Enhancement in Spatial Domain
Point Processing When doing so you actually perform a special type of image processing known as point processing.
Key Stages in Digital Image Processing
Transforming Data.
Histogram Equalization
Discussion #29 – Images II
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Image Enhancement in the Spatial Domain
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Digital Image Processing Week III
Digital Image Procesing Introduction to Image Enhancement Histogram Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL PROCESSING IMPERIAL.
Grey Level Enhancement
CIS 4350 Image ENHANCEMENT SPATIAL DOMAIN
Intensity Transformations and Spatial Filtering
Histogram The histogram of an image is a plot of the gray _levels values versus the number of pixels at that value. A histogram appears as a graph with.
Image Enhancement in Spatial Domain: Point Processing
Presentation transcript:

SCCS 4761 Point Processing Basic Image Processing Operations Arithmetic Operations Histograms

SCCS 4762 Basic Image Processing Operations Transforms –process entire image as one large block Neighborhood processing –process the pixel in a small neighborhood of pixels around the given pixel. Point operations –process according to the pixel’s value alone (single pixel). Image-Processing operations may be divided into 3 classes based on information required to perform the transformation.

SCCS 4763 Schema of Image Processing Image Transformed Image Transform Output Image Inverse Transform Processed Transformed Image Image-processing operation

SCCS 4764 Arithmetic Operations Addition Subtraction Multiplication Division Complement

SCCS 4765 Arithmetic Operations (cont) Addition: y = x + c Subtraction: y = x - c Multiplication: y = cx Division: y = x/c Complement: y= x Let x is the old gray value, y is the new gray value, c is a positive constant.

SCCS 4766 Arithmetic Operations (cont) Addition: y = x + c Subtraction: y = x - c Multiplication: y = cx Division: y = x/c Complement: y= x To ensure that the results are integers in the range [0, 255], the following operations should be performed Rounding the result to obtain an integer Clipping the result by setting y = 255 if y > 255 y = 0 if y < 0

SCCS 4767 Arithmetic Operations (cont) MATLAB functions –Addition: imadd(x,y) Add two images or add constant to image –Subtraction: imsubstract(x,y) Subtract two images or subtract constant to image –Multiplication: immultiply(x,y) Multiply two images or multiply image by constant –Division: imdivide(x,y) Divide two images or divide image by constant –Complement: imcomplement(x)

SCCS 4768 Addition & Subtraction Lighten/darken the image Some details may be lost MATLAB: –commands: x = imread(‘filename.ext’); y = uint8(double(x) + c); or y = uint8(double(x) - c); –function: x = imread(‘filename.ext’); y = imadd(x, c); or y = imsubtract(x, c);

SCCS 4769 Ex: Addition & Subtraction Added by 128 Subtracted by 128 Draw graphs of the transformation functions !!!

SCCS Multiplication & Division Lighten/darken the image Some details may be lost (but less than addition/subtraction) MATLAB: –commands: x = imread(‘filename.ext’); y = uint8(double(x)*c); or y = uint8(double(x)/c); –functions: x = imread(‘filename.ext’); y = immultiply(x, c); or y = imdivide(x, c);

SCCS Ex: Multiplication & Division Multiplied by 2 Divided by 2 Draw graphs of the transformation functions !!!

SCCS Comparison: Addition VS Multiplication

SCCS Comparison: Subtraction VS Division

SCCS Complement Create the negative image MATLAB: –commands: x = imread(‘filename.ext’); y = uint8(255 - double(x)); –function: x = imread(‘filename.ext’); y = imcomplement(x);

SCCS Ex: Complement Draw a graph of the transformation function !!!

SCCS Histogram Graph showing the number of pixels for each intensity Normalized histogram: histogram where the number of pixel is divided by the total number of pixel so the range is [0,1] Cumulative histogram: histogram which shows the number of pixels whose intensity is less or equal to each intensity.

SCCS Histogram Example >> p = imread(‘pout.tif’) >> inshow(p) >> figure;imhist(p)

SCCS What Histogram Describes? Brightness –dark image has gray levels (histogram) clutered at the lower end. –bright image has gray levels (histogram) clutered at the higher end. Contrast –well contrasted image has gray levels (histogram) spread out over much of the range. –low contrasted image has gray levels (histogram) clutered in the center.

SCCS Contrast Enhancement by Spreading Out Histogram Histogram Stretching (Contrast Stretching) Histogram Equalization

SCCS Histogram Stretching 0 max I I #pixel IminImax

SCCS Steps of Histogram/Contrast Stretching Create the histogram of the image Gray level ( i ) No. of gray value ( n i ) 0…………………………………………….15 1…………………………………………….. 0 2…………………………………………….. 0 3……………………………………………..0 4…………………………………………….. 0 5…………………………………………….70 6……………………………………………110 7…………………………………………….45 8……………………………………………70 9…………………………………………….35 10……………………………………… ………………………………………… ………………………………………… …………………………………………… 0 14…………………………………………… 0 15………………………………………….. 15 Draw the histogram.

SCCS Steps of Histogram/Contrast Stretching (cont) From the histogram, stretch out the gray levels in the center of the range by applying the piecewise linear function –Ex: [5,9]  [2,14] – y = [(14 – 2)/(9 – 5)](x – 5) + 2, Draw a graph of transformation Gray levels outside this range are either left as original values or transforming according to the linear function at the ends of the graph. xy

SCCS Steps of Histogram/Contrast Stretching (cont) Change the old gray values to the new gray values by using the piecewise linear function from the previous step as a mapping function. Create the histogram from the new image

SCCS Histogram Stretching: Example originaloutput

SCCS Histogram before/after Adjustment Before After

SCCS Histogram Mapping: Piecewise Linear I #pixel IminImax I #pixel IminImax Mapping function: Ix1 Ix2 Iy1 Iy2

SCCS MATLAB: Histogram/Contrast Stretching Command: imadjust Syntax: imadjust(x, [ a,b], [c,d]); imadjust(x, [ a,b], [c,d],  ); –convert intensity x  a to c –convert intensity x  b to d –values of a,b,c,d must be between 0 and 1 –  : positive constant (describe the shape of the function, 1 concave upward)

SCCS Transformation Function with Gamma (Power –Law Transformation) Brighten image Linear mapping Darken image

SCCS Example of Adjusting by the Power- Law Transformation Original Adjust by using Gamma = 0.5

SCCS MATLAB: Piecewise Linear A MATLAB function for applying a piecewise linear-stretching function (see Figure 4.15) Command: find Syntax: find(condition) Ex pix = find(im >= a(i) & im < a(i+1)); pix holds the index for members in im having intensity between a(i) and a(i+1) include a(i).

SCCS Histogram Equalization The trouble with the methods of histogram stretching is that they require user input. Histogram equalization is an entirely automatic procedure. Idea: Each gray level in the image occurs with the same frequency. Give the output image with uniform intensity distribution.

SCCS Histogram Equalization (cont) Mapping function: where p(i) is the PDF of the intensity level i, obtained from cumulative histogram.

SCCS Histogram Equalization: Procedure Example: Suppose a 4-bit grayscale image has the histogram associated with a table of the numbers n i of gray values. (page 78)

SCCS Histogram Equalization: Example BEFOREAFTER

SCCS MATLAB: Histogram Equalization Command: histeq Syntax: histeq(image, target_hist) histeq(image, #bin) histeq(indexed_im, #bin, target_hist) histeq(indexed_im, map, #bin) Default: #bin = 64 Output: output_im, [output_im, transform], new_map, [new_map, transform]

SCCS Lookup Tables Improve the performance of point processing Why? –one intensity is always mapped to the same value –reduce the computing time Lookup table: array Input intensity: index in the array Output intensity: value of the member

SCCS Ex: Lookup Table (1) Function: output = input/2; MATLAB >> T = uint8(floor(0:255)/2); >> output = T(input);

SCCS Ex: Lookup Table in MATLAB (2) Function: MATLAB >> T1 = *[0:95]; >> T2 = 2*[96:160] – 128; >> T3 = *[161:255] ; >> T = uint8(floor([T1 T2 T3]));