Digital Image Fundamentals Part 2 - Islamic University Of Gaza

2y ago
125 Views
24 Downloads
703.75 KB
7 Pages
Last View : 2m ago
Last Download : 2m ago
Upload by : Joanna Keil
Transcription

Islamic University Of GazaFaculty of EngineeringComputer DepartmentEng. Ahmed M. AyashDigital Image ProcessingDiscussionChapter 2Date: 24/02/2013Chapter 2Digital Image FundamentalsPart 21. Theoretical Basic Relationships Between Pixels NeighborhoodAdjacencyConnectivityPathsRegions and boundariesNeighbors of a Pixel The 4- neighbors of pixel p are: N4(p)Any pixel p(x,y) has two vertical and two horizontal neighbors,given by:(x 1, y), (x-1, y), (x, y 1), (x, y-1) The 4- diagonal neighbors are: ND(p)given by:(x 1, y 1), (x 1, y-1), (x-1, y 1), (x-1, y-1) The 8-neighbors are : N8(p)8-neighbors of a pixel pare its vertical, horizontal and 4 diagonal neighborsdenoted by N8(p)N8(p) N4(p) U ND(p)1

ConnectivityTwo pixels are said to be connected if they are adjacent in some sense.o They are neighbors (N4, ND, N8) ando Their intensity values (gray levels) are similar.AdjacencyLet V be the set of intensity used to define adjacency; e.g. V {1} in a binary image orV {100,101,102, ,120} inn a gray-scale image.We consider three types of adjacency:o 4-adjacency:Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p).o 8-adjacency:Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p).o m-adjacency (mixed adjacency):Two pixels p and q with values from V are m-adjacent if:(i) q is in N4(p),or(ii) q is in ND( p) and N4(p) N4(q) is empty (has no pixels whose valuesare from V )Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to somepixel in S2.Question1:Consider the two image subsets, S1 and S2, shown in the following figure. For V {1},determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent, or (c) m-adjacent.2

Solution:Let p and q be as shown in Fig. Then:(a) S1 and S2 are not 4-connected because q is not in the set N4(p);(b) S1 and S2 are 8-connected because q is in the set N8(p);(c) S1 and S2 are m-connected because(i) q is in ND(p), and(ii) the set N4(p) N4(q) is empty.PathsA (digital) path (or curve) from pixel p with coordinates (x, y) to pixel q withcoordinates (s, t) is a sequence of distinct pixels with coordinates(x0, y0), (x1,y1), ., (xn, yn)ooooowhere (x0, y0) (x, y), (xn, yn) (s, t),and pixels (xi, yi) and (xi-1, yi-1) are adjacent for 1 i n.In this case, n is the length of the path.If (x0, y0) (xn, yn) the path is a closed path.The path can be defined 4-,8-,m-paths depending on adjacency type.Let S be a subset of pixels in an image. Two pixels p and q are said to be connectedin S if there exists a path between them consisting entirely of pixels in S For any pixel p in S, the set of pixels that are connected to it in S is called aconnected component of S.If it only has one connected component, then set S is called a connected set.Question2:Consider the image segment shown.Let V {0, 1} and compute the lengths of the shortest 4-, 8-, and m-path between pand q. If a particular path does not exist between these two points, explain why.3

Solution: When V {0,1}, 4-path does not exist between p and q because it is impossibleto get from p to q by traveling along points that are both 4-adjacent and also havevalues from V . Fig. a shows this condition; it is not possible to get to q.The shortest 8-path is shown in Fig. b its length is 4.The length of the shortest m- path (shown dashed) is 5.Both of these shortest paths are unique in this case. Regions and boundaries Let R be a subset of pixels in an image. We call R a region of the image if R is aconnected set. The boundary (also called border or contour) of a region R is the set of pixels inthe region that have one or more neighbors that are not in R. Distance MeasuresGiven pixels p, q and z with coordinates (x, y), (s, t), (u, v) respectively, the distancefunction D has following properties:o D(p, q) 0 [D(p, q) 0, iff p q]o D(p, q) D(q, p)o D(p, z) D(p, q) D(q, z) The following are the different Distance measures:a. Euclidean Distance:De(p, q) [(x-s)2 (y-t)2]1/2-The pixels having a distance less than or equal to some value r from (x, y) arethe points contained in a disk of radius r centered at (x, y).b. City Block Distance:D4(p, q) x-s y-t -The pixels having a D4 distance from (x, y) less than or equal to some value rform a diamond centered at (x, y). For example, the pixels with D4 distance 2from (x, y) (the center point) form the following contours of constant distance:4

-The pixels with D4 1 are the 4-neighbors of (x, y).c. Chess Board Distance:D8(p, q) max( x-s , y-t )-The pixels with D8 distance from (x, y) less than or equal to some value r form asquare centered at (x, y). For example, the pixels with D8 distance 2 from (x, y)(the center point) form the following contours of constant distance:-The pixels with D8 1 are the 8-neighbors of (x, y).2. PracticalExample1: Image rotate%ex1.mclear all;I imread('1.jpg');J imrotate(I,35); %rotates an image 35 inal');subplot(122),imshow(J),title('Rotatated by 35');Output:5

Example2: Cropping an Image%ex2.mclear all;I imread('1.jpg');J imrotate(I,35);J2 ;subplot(132),imshow(J),title('Rotatated by 35');subplot(133),imshow(J2),title('Rotatated by 35 croped');Output:6

3. Homework:1. Consider the image segment shown.Let V {1, 2} and compute the lengths of the shortest 4-, 8-, and m-path between p and q. If aparticular path does not exist between these two points, explain why.2. Write a Matlab code to rotate an image by 180 (do not use the imrotate function, you shouldimplement it)Hint (Use end function)3. Given the two images below, perform an enhancement operation to get Fig (1).Hint (Use a logical operation)Fig (1)7

Digital Image Fundamentals Part 2 1. Theoretical Basic Relationships Between Pixels Neighborhood Adjacency Connectivity Paths Regions and boundaries Neighbors of a Pixel (p)The 4- neighbors of pixel p are: N 4 Any pixel p(x,y) has two vertical and two horizontal neighbors, given by:

Related Documents:

Digital Image Fundamentals Titipong Keawlek Department of Radiological Technology Naresuan University Digital Image Structure and Characteristics Image Types Analog Images Digital Images Digital Image Structure Pixels Pixel Bit Depth Digital Image Detail Pixel Size Matrix size Image size (Field of view) The imaging modalities Image Compression .

L2: x 0, image of L3: y 2, image of L4: y 3, image of L5: y x, image of L6: y x 1 b. image of L1: x 0, image of L2: x 0, image of L3: (0, 2), image of L4: (0, 3), image of L5: x 0, image of L6: x 0 c. image of L1– 6: y x 4. a. Q1 3, 1R b. ( 10, 0) c. (8, 6) 5. a x y b] a 21 50 ba x b a 2 1 b 4 2 O 46 2 4 2 2 4 y x A 1X2 A 1X1 A 1X 3 X1 X2 X3

A digital image is a 2D representation of a scene as a finite set of digital values, calledpicture elements or pixels or pels. The field of digital image processing refers to processing digital image by means of a digital computer. NOTE: A digital image is composed of finite number of elements like picture elements, image

Digital Image Fundamentals Human and Computer Vision We can’t think of image processing without considering the human vision system. We observe and evaluate the images that we process with our visual system. Digital Image Processing

02 –Digital Image Fundamentals prepared by jimmyhasugian. 1/25/2017 2 There are many image processing applications and . To create a digital image, we need to convert the continuoussensed data into digital form. Image Sampling and Quantization Sampling Quanti

DIGITAL IMAGE FUNDAMENTALS & IMAGE TRANSFORMS The field of digital image processing refers to processing digital images by means of a digital computer. An image may be defined as a two- dimensional function, f(x,y) where x and y are spatial (plane) coordinates, and the amplitude of f at any pair of coordinates (x, y) is called the intensity or .

Digital image processing is the use of computer algorithms to perform image processing on digital images. As a . Digital cameras generally include dedicated digital image processing chips to convert the raw data from the image sensor into a color-corrected image in a standard image file format. I

Fundamental Steps in Digital Image Processing Fig 1.1: Steps involved in an Digital Image Processing Image acquisition is the creation of digital images, typically from a physical scene. The most usual method is by digital photography with a digital camera.