Basic relations between pixels (Chapter 2)

Similar documents
In this lecture. Background. Background. Background. PAM3012 Digital Image Processing for Radiographers

IMAGE ENHANCEMENT in SPATIAL DOMAIN by Intensity Transformations

Intensity Transformation and Spatial Filtering

Digital Image Processing. Lecture # 3 Image Enhancement

Lecture 4 Image Enhancement in Spatial Domain

ECE 178: Introduction (contd.)

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Image Enhancement in Spatial Domain. By Dr. Rajeev Srivastava

Lecture 3 - Intensity transformation

Interpolation is a basic tool used extensively in tasks such as zooming, shrinking, rotating, and geometric corrections.

Selected Topics in Computer. Image Enhancement Part I Intensity Transformation

IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Chapter 3: Intensity Transformations and Spatial Filtering

Image Enhancement: To improve the quality of images

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Introduction to Digital Image Processing

Digital Image Fundamentals II

Digital Image Processing

Digital Image Analysis and Processing

Sampling and Reconstruction

Lecture 4. Digital Image Enhancement. 1. Principle of image enhancement 2. Spatial domain transformation. Histogram processing

Chapter - 2 : IMAGE ENHANCEMENT

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

IMAGING. Images are stored by capturing the binary data using some electronic devices (SENSORS)

Digital Image Processing

Image Enhancement in Spatial Domain (Chapter 3)

Intensity Transformations and Spatial Filtering

Digital Image Processing, 2nd ed. Digital Image Processing, 2nd ed. The principal objective of enhancement

UNIT - 5 IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Digital Image Processing. Image Enhancement (Point Processing)

VC 16/17 TP5 Single Pixel Manipulation

UNIT-2 IMAGE REPRESENTATION IMAGE REPRESENTATION IMAGE SENSORS IMAGE SENSORS- FLEX CIRCUIT ASSEMBLY

Digital Image Processing

Digital Image Processing

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

Intensity Transformations. Digital Image Processing. What Is Image Enhancement? Contents. Image Enhancement Examples. Intensity Transformations

EC-433 Digital Image Processing

Image Processing Lecture 10

Lecture No Image Enhancement in SpaPal Domain (course: Computer Vision)

Filtering and Enhancing Images

Motivation. Intensity Levels

Basic Algorithms for Digital Image Analysis: a course

EELE 5310: Digital Image Processing. Lecture 2 Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

Introduction to Digital Image Processing

EELE 5310: Digital Image Processing. Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

Digital Image Processing

Digital Image Processing. Introduction

Digital Image Processing, 3rd ed. Gonzalez & Woods

NAME :... Signature :... Desk no. :... Question Answer

Motivation. Gray Levels

Topological structure of images

Lecture 6: Edge Detection

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

Topological structure of images

Lecture 4: Spatial Domain Transformations

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

EE795: Computer Vision and Intelligent Systems

Mathematical Morphology and Distance Transforms. Robin Strand

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Chapter 2: Digital Image Fundamentals

Lecture 2 Image Processing and Filtering

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

Topic 6 Representation and Description

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Edge and local feature detection - 2. Importance of edge detection in computer vision

EE663 Image Processing Histogram Equalization I

Ulrik Söderström 16 Feb Image Processing. Segmentation

Digital Image Processing ERRATA. Wilhelm Burger Mark J. Burge. An algorithmic introduction using Java. Second Edition. Springer

MR IMAGE SEGMENTATION

Point Operations. Prof. George Wolberg Dept. of Computer Science City College of New York

Digital Image Fundamentals

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

What is an Image? Image Acquisition. Image Processing - Lesson 2. An image is a projection of a 3D scene into a 2D projection plane.

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

EE 584 MACHINE VISION

Morphological Image Processing

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Original grey level r Fig.1

Lecture 7: Most Common Edge Detectors

Image Enhancement. Digital Image Processing, Pratt Chapter 10 (pages ) Part 1: pixel-based operations

Digital Image Processing. Image Enhancement - Filtering

Image Acquisition + Histograms

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

SECTION 5 IMAGE PROCESSING 2

Point and Spatial Processing

Linear Operations Using Masks

(Refer Slide Time 00:17) Welcome to the course on Digital Image Processing. (Refer Slide Time 00:22)

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Segmentation and Grouping

PROCESS > SPATIAL FILTERS

4-Border and 4-Boundary

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

Analysis and extensions of the Frankle-McCann

Filtering Images. Contents

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations I

Lecture #5. Point transformations (cont.) Histogram transformations. Intro to neighborhoods and spatial filtering

Chapter4 Image Enhancement

CS 548: Computer Vision and Image Processing Digital Image Basics. Spring 2016 Dr. Michael J. Reale

Transcription:

Basic relations between pixels (Chapter 2) Lecture 3 Basic Relationships Between Pixels Definitions: f(x,y): digital image Pixels: q, p (p,q f) A subset of pixels of f(x,y): S A typology of relations: Neighborhood Adjacency Connectivity Region & boundary Distance 1

Neighbors of a Pixel A pixel p at (x,y) has 2 horizontal and 2 vertical neighbors: (x+1,y), (x-1,y), (x,y+1), (x,y-1) This set of pixels is called the 4-neighbors of p: N 4 (p) p Neighbors of a Pixel The 4 diagonal neighbors of p are: (N D (p)) (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1) p N 4 (p) + N D (p) N 8 (p): the 8-neighbors of p 2

Adjacent pixels Two pixels are adjacent if: They are neighbors in some sense (e.g. N 4 (p), N 8 (p), ) Their gray levels satisfy a specified criterion of similarity V (e.g. equality, ) V is the set of gray-level values used to define adjacency (e.g. V={1} for adjacency of pixels of value 1) Adjacency (cont.) p is adjacent to q if: { } q N 4 ( p),n 8 ( p),... f ( p) V f ( q) V We consider three types of adjacency: 4-adjacency: two pixels p and q with values from V are 4- adjacent if q is in the set N 4 (p) 8-adjacency: two pixels p and q with values from V are 8- adjacent if q is in the set N 8 (p) 3

Adjacency (cont.) The third type of adjacency: m-adjacency: p and q with values from V are m-adjacent if: q is in N 4 (p) or q is in ND (p) and the set N 4 (p) N 4 (q) has no pixels with values from V Mixed adjacency is a modification of 8-adjacency and is used to eliminate the multiple path connections that often arise when 8- adjacency is used. Adjacency An example N 4 (p) N 4 (q) 4

Adjacency - An example N 4 (p) N 4 (q) Subset Adjacency Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2. 5

Paths A path (curve) from pixel p with coordinates (x,y) to pixel q with coordinates (s,t) is a sequence of distinct pixels: Q : (x 0,y 0 ), (x 1,y 1 ),, (x n,y n ) where (x 0,y 0 )=(x,y), (x n,y n )=(s,t), and (x i,y i ) is adjacent to (x i-1,y i-1 ), for 1 i n n is the length of the path ( Q ). If (x 0, y 0 ) = (x n, y n ), then Q is a closed path 4-, 8-, and m-paths can be defined depending on the type of adjacency specified. Connectivity Connectivity between pixels is important for establishing boundaries of objects and components of regions in an image 6

Connectivity Two pixels (p S, q S) are connected in S if there exists a path between them consisting entirely of pixels in S For any pixel p in S, the set of pixels in S that are connected to p is a connected component of S. If S has only one connected component then S is called a connected set. Region & Boundary Let R be a subset of pixels: R is a region if R is a connected set. Its boundary (border, contour) is the set of pixels in R that have at least one neighbor not in R An edge can be the region boundary (in binary images) 7

Distance Measures For pixels p,q,z with coordinates (x,y), (s,t), (u,v), D is a distance function or metric if: D(p,q) 0 (D(p,q)=0 iff p=q) D(p,q) = D(q,p) and D(p,z) D(p,q) + D(q,z) Distance Measures Euclidean distance: D e (p,q) = [(x-s) 2 + (y-t) 2 ] 1/2 Points (pixels) having a distance less than or equal to r from (x,y) are contained in a disk of radius r centered at (x,y). 8

Distance Measures D 4 distance (city-block distance): D 4 (p,q) = x-s + y-t forms a diamond centered at (x,y) e.g. pixels with D 4 2 from p D 4 = 1 are the 4-neighbors of p Distance Measures D 8 distance (chessboard distance): D 8 (p,q) = max( x-s, y-t ) Forms a square centered at p e.g. pixels with D 8 2 from p D 8 = 1 are the 8-neighbors of p 9

Distance Measures D 4 and D 8 distances between p and q are independent of any paths that exist between the points because these distances involve only the coordinates of the points (regardless of whether a connected path exists between them). However, using m-adjacency the value of the distance (length of path) between two pixels depends on the values of the pixels along the path and those of their neighbors. Distance Measures e.g. assume p, p 2, p 4 = 1 or 1 p 1, p 3 = can have either 0 If only connectivity of pixels valued 1 is allowed, and p 1 and p 3 are 0, the m- distance between p and p 4 is 2. If either p 1 or p 3 is 1, the distance is 3. If both p 1 and p 3 are 1, the distance is 4 (p p1 p2 p3 p4) 10

Image Enhancements in the spatial domain: Intensity Transformations (chapter 3) (Lecture 3) Image statistics Consider an image f as a series of random samples, where each pixel, f(x,y), is a sample at (x,y). The samples can be described by: The mean value (a measure of the overall brightness): f = 1 MN f ( x, y) The standard deviation (a measure of the overall contrast): M N σ = 1 MN M N ( f ( x, y) f ) 2 Other summary statistics may also be used (min, max, median, ) 11

Image Enhancement Processing an image so that the result is more suitable than the original image for a specific application. Problem oriented May be subjective There is no general theory of image enhancement Two primary categories (may be combined): Spatial domain methods frequency domain methods Spatial Domain Methods Procedures that operate directly on the aggregate of pixels composing an image A neighborhood about (x,y) is defined by using a square (or rectangular) sub-image area centered at (x,y). 12

Spatial Domain Methods Mask processing or filtering: when the values of f in a predefined neighborhood of (x,y) determine the value of g at (x,y). Through the use of masks (or kernels, templates, or windows, or filters). Spatial Domain Methods When the neighborhood is 1 x 1 then g depends only on the value of f at (x,y) and T becomes a gray-level transformation (or mapping) function (point operation): s=t(r), T:Z + Z + r and s are the gray levels of f(x,y) and g(x,y) at (x,y), where: r denotes the pixel intensity before processing s denotes the pixel intensity after processing. Point processing techniques (e.g. contrast stretching, thresholding) 13

Contrast Stretching & Thresholding Contrast Stretching Thresholding Some Simple Intensity Transformations Image negatives Piecewise-Linear Transformation Functions: Contrast stretching Gray-level slicing Bit-plane slicing Implemented via Look-Up Tables (LUT) where values of T are stored in a 1-D array (for 8-bit, the LUT will have 256 values) 14

Some basic transformations Image Negatives Function reverses the order from black to white so that the intensity of the output image decreases as the intensity of the input increases. Used mainly in medical images and negative scanning. 15

Negative of an image The negative is obtained by using the following transformation function s=t(r): [0,L-1] the range of gray levels S= L-1-r Negative - example Aerial image The negative 16

Log Transformations s = c log(1+r) where r 0 and c is a constant Compresses the dynamic range of images with large variations in pixel values Log transform - example Dynamic range: 0 1.5x10 6 Dynamic range: 0 6.2 17

Power-Law Transformations C, γ : positive constants γ=c=1: Identity transformation Gamma correction Used to correct the output of devices that have a power-law response For example: CRT monitors Most computer displays have a intensity-to-voltage response curve which is roughly a 1.8 to 2.5 power function. Consequently, such displays will generate a darker image than the original. To correct this, we could use the inverse power function, for example: S=r 1/2.5 =r 0.4 18

Gamma Correction - example Gamma Correction - example Original image Brightness Gamma correction 19

Piecewise-Linear Transformation Functions - Contrast Stretching To increase the dynamic range of the gray levels in the image being processed. αr s = β r r 1 γ r r 2 0 r r ( ) + s 1 r 1 < r r 2 ( ) + s 2 r 2 < r L 1 20

Contrast Stretching The locations of (r 1,s 1 ) and (r 2,s 2 ) control the shape of the transformation function. If r 1 = s 1 and r 2 = s 2 the transformation is a linear function and produces no changes. If r 1 =r 2, s 1 =0 and s 2 =L-1, the transformation becomes a thresholding function that creates a binary image. Contrast Stretching More on function shapes: Intermediate values of (r 1,s 1 ) and (r 2,s 2 ) produce various degrees of spread in the gray levels of the output image, thus affecting its contrast. Generally, r 1 r 2 and s 1 s 2 is assumed. 21

Gray-Level Slicing To highlight a specific range of gray levels in an image (e.g. to enhance certain features). One way is to display a high value for all gray levels in the range of interest and a low value for all other gray levels (binary image). 22

Gray-Level Slicing The second approach is to brighten the desired range of gray levels but preserve the background and gray-level tonalities in the image: 23

Bit-Plane Slicing Analyzing the contribution made to the total image appearance by specific bits. i.e. Assuming that each pixel is represented by 8 bits, the image is composed of 8 1-bit planes. Plane 0 contains the least significant bit and plane 7 contains the most significant bit. Bit-plane slicing is useful for image compression Bit-Plane Slicing Usually, only the higher order bits (top four) contain visually significant data. The other bit planes contribute the more subtle details. Plane 7 corresponds exactly with an image thresholded at gray level 128. 24

Bit-plane slicing An example f(x,y) 15 26 128 200 211 98 17 21 34 15 26 128 25

Bit-plane slicing: example Bit-plane slicing: example (cont.) 26

Bit 1 Bit 2 Bit 4 Bit 5 Bit 7 Bit 8 Bit 3 Bit 6 27

Bit-plane slicing: example 28