100% found this document useful (2 votes)
739 views6 pages

Neighbors of Pixel

The document discusses the concept of pixel neighbors in a digital image. There are two main types of pixel neighbors: 4-neighbors, which include pixels directly above, below, left and right of the given pixel; and 8-neighbors, which additionally include pixels on the diagonals. Connectivity between pixels is determined based on whether a neighboring pixel is in the 4-neighbor or 8-neighbor set.

Uploaded by

Claire Verdeflor
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
739 views6 pages

Neighbors of Pixel

The document discusses the concept of pixel neighbors in a digital image. There are two main types of pixel neighbors: 4-neighbors, which include pixels directly above, below, left and right of the given pixel; and 8-neighbors, which additionally include pixels on the diagonals. Connectivity between pixels is determined based on whether a neighboring pixel is in the 4-neighbor or 8-neighbor set.

Uploaded by

Claire Verdeflor
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Neighbors of Pixel

Pixel Resolution Neighbor of pixels Space and Frequency Vector PIXEL Pixel is a smallest component of digital image Pixel is a color point of digital image An image should be comprised of many Pixels. PIXEL RESOLUTION How quality of image With the same size of picture If high resolution, high memory is required to store data If low resolution, less memory is required to store data

There are two different ways to define the neighbors of a pixel

located at

: 4-neighbors

The 4-neighbors of pixel p, denoted by

, are the four pixels

located at

, and

, there are, respectively, above (north), below (south), to the left (west) and right (east) of the pixel p. 8-neighbors

The 8-neighbors of pixel p, denoted by , include the four 4neighbors and four pixels along the diagonal direction located at

(northwest),

(northeast),

Its unit is call point per inch RESOLUTION Digital Image Representation Neighbors of a pixel Neighbors of pixel are the pixels that are adjacent pixels of an identified pixel. Each pixel is a unit distance from the particular pixel. Some of the neighbors of pixel lie outside the digital image if its position is on the border of the image. Pixel at coordinate (column x, row y) can be represented by f(x,y) 4-neighbors of pixel 4-neighbors of pixel is denoted by N4(p) It is set of horizontal and vertical neighbors Diagonal neighbors of pixel Diagonal neighbors of pixel is denoted by ND(p) It is set of diagonal neighbors 8-neighbors of pixel 8-neighbors of pixel is denoted by N8(p) 4-neighbors and Diagonal neighbors of pixel

(southwest) and (southeast).

Digital Image Fundamentals Faculty of Science Silpakorn University Overviews Elements of Visual Perception Term of image Sampling and Quantization Term of image

Connectivity Establishing boundaries of objects and components of regions in an image.

Calculate between p and q is defined as D8(p,q) = max(| px- qx |,| py- qy |)

Group the same region by assumption that the pixels being the same color or equal intensity will are the same region Connectivity Let C is the set of colors used to define There are three type of connectivity: 4-Connectivity : 2 pixels (p and q) with value in C are 4connectivity if q is in the set N4(p) 8-Connectivity : 2 pixels (p and q) with value in C are 8connectivity if q is in the set N8(p) M-Connectivity : 2 pixels (p and q) with value in C are 8-connectivity if (i) (ii) Q is in N4(p), or Q is in ND(p) and the set N4(p) N4(q) is empty

Labeling of connected Components Scan an image pixel by pixel from left to right and top to bottom There are 2 types of connectivity interested 4-connectivity 8-connectivity

Equivalent labeling Step: 4-connected components P is pixel scanned process If pixel p is color value 0 move on the next scaning If pixel p is color value 1 examine pixel top and left If top and left were 0, assign a new label to p If only one of themre 1, assign its label to p If both of themre 1 and have the same number, assign their label to p Different number, assign label of top to p and make note that two label is equivalent

Binary Image Represent Example 4-Connectivity Set of color consists of color 1 ; C ={1} Example 8-Connectivity Set of color consists of color 1 ; C ={1} Example M-Connectivity Set of color consists of color 1 ; C ={1} Distance Measure For pixels p, q, and z, with coordinates (x,y), (s,t) and (u,v) respectively, D is a distance function or metric if D(p,q) 0 and D(p,q) = 0 iff p = q and D(p,q) = D(q,p) and D(p,z) D(p,q) + D(q,z)

Sort all pairs of equivalent labels and assign each equivalent to be same type Example 4-connected components Step: 8-connected components Steps are same as 4-connected components But the pixel that are consider is 4 previous pixels ( top-left, top, top-right, and left ) Example 8-connected components Multi-Color Labeling Well define the group of color clearly and independency. Then label each group independency. Example Multi-Color labeling Color Labeling 1st Group Color Labeling 2st Group Color Labeling 3st Group Exercise If we want to label red and yellow is the same group.

The D4 Distance Also called city-block distance Calculate between p and q is defined as D4(p,q) = | px- qx | + | py- qy |

The D8 Distance Also called city-block distance

How many label we can get?

Relationship between Pixels: A pixel p at coordinates (x, y) has four horizontal and vertical neighbors whose coordinates are given by (x+1, y), (x-1, y), (x, y+1), (x, y-1). This set of pixels called the 4neighbors of p, is denoted by N4(p). Each pixel is a unit distance from (x, y), and some of the neighbors of p lie outside the digital image if (x, y) is on the border of the image. The four diagonal neighbors of p have coordinates (x+1, y+1), (x+1, y-1), (x-1, y+1), (x1, y-1) and are denoted by ND(p). These points, together with the 4-neighbors, are called the 8neighbors of p, denoted by N8(p). As before, some of the points in ND(p) and N8(p) fall outside the image if (x, y) is on the border of the image.

In character recognition, the key role of segmentation is to extract individual characters and words from the background. Representation and Description: It is a process which transforms raw data into a form suitable for subsequent computer processing. The first decision is to choose between boundary representation and regional representation. Boundary representation is used when the details of external shape characteristics is important where as the regional representation is used when the internal properties are important. Object Recognition: It is a process that assigns a label to an object based on its descriptors i.e., the information provided by its descriptors and the recognized object is interpreted by assigning a meaning to it. Knowledge Base: The function of knowledge base is to guide the operation of each processing module and control the interaction between them. A feedback request through the knowledge base to the segmentation stage for another look is an example of knowledge utilization in performing image processing tasks.

Color Image Processing: As we know, to restore the natural characteristics of an image it is necessary to preserve the color information associated with an image. For this purpose we go for color image processing. Wavelets and Multi-resolution: This is the foundation for representing images in various degrees of resolution. Particularly it is employed for image data compression and for pyramidal representation where images are subdivided into successively into smaller regions. Compression: This technique is used for the storage required to save an image or the bandwidth required to transmit it which is most important in Internet applications. Morphological Processing: It deals with tools for extracting image components useful in representation and description of shape. Segmentation: It may be defined as portioning an input image into its constituent parts or objects. It is very important to distinguish between different objects in an image as in the case of systems employed for traffic control, or crowd control.

Concept of Gray Level: It is the brightness of a pixel. The value associated with a pixel representing its lightness from black to white. Usually defined as, a value from 0 to 255, with 0 being black and 255 being white. Concept in Image Sampling and Quantization: Formation of digital image from a continuous image basically involves two steps. They are Sampling and Quantization. An image may be continuous with respect to x and y coordinates and also in amplitude. Digitizing the coordinate values is called sampling whereas digitizing the amplitude values is called quantization.

The above figure-1 shows a continuous image f(x,y) which we want to digital form. Let us take the gray

level values of the continuous image along the line segment AB.

For more details on this topic, see Nearest-neighbor interpolation.

The random variations that are seen are due to image noise. This function is sampled and quantized to get digital output.

The simplest interpolation method is to locate the nearest data value, and assign the same value. In simple problems, this method is unlikely to be used, as linear interpolation (see below) is almost as easy, but in higher dimensional multivariate interpolation, this could be a favourable choice for its speed and simplicity.
Linear interpolation

Sampling is done by taking equally spaced samples along the line AB. The location of each sample is given a vertical tick mark in the bottom part of the figure-3. The set of these discrete locations gives the sampled function. However, the values of the samples still span a continuous range of gray-level values. In order to form a digital function, the gray-level values also must be converted into discrete quantities. The right side of the figure-3 shows the gray-level scale divided into eight discrete levels ranging from black to white. The vertical tick marks indicates the specific value assigned to each of the eight gray levels. The continuous gray levels are quantized simply by assigning one of the eight discrete gray levels to each sample. The assignment is made depending on the vertical proximity of a sample to a vertical tick mark. Piecewise constant interpolation

Plot of the data with linear interpolation superimposed Main article: Linear interpolation

One of the simplest methods is linear interpolation (sometimes known as lerp). Consider the above example of estimating f(2.5). Since 2.5 is midway between 2 and 3, it is reasonable to take f(2.5) midway between f(2) = 0.9093 and f(3) = 0.1411, which yields 0.5252. Generally, linear interpolation takes two data points, say (xa,ya) and (xb,yb), and the interpolant is given by:

at the point (x,y)

Piecewise constant interpolation, or nearest-neighbor interpolation.

Linear interpolation is quick and easy, but it is not very precise. Another disadvantage is that the interpolant is not differentiable at the point xk.

The following error estimate shows that linear interpolation is not very precise. Denote the function which we want to interpolate by g, and suppose that x lies between xa and xb and that g is twice continuously differentiable. Then the linear interpolation error is

Generally, if we have n data points, there is exactly one polynomial of degree at most n1 going through all the data points. The interpolation error is proportional to the distance between the data points to the power n. Furthermore, the interpolant is a polynomial and thus infinitely differentiable. So, we see that polynomial interpolation overcomes most of the problems of linear interpolation. However, polynomial interpolation also has some disadvantages. Calculating the interpolating polynomial is computationally expensive (see computational complexity) compared to linear interpolation. Furthermore, polynomial interpolation may exhibit oscillatory artifacts, especially at the end points (see Runge's phenomenon). More generally, the shape of the resulting curve, especially for very high or low values of the independent variable, may be contrary to commonsense, i.e. to what is known about the experimental system which has generated the data points. These disadvantages can be reduced by using spline interpolation or restricting attention to Chebyshev polynomials.
Spline interpolation

In words, the error is proportional to the square of the distance between the data points. The error in some other methods, including polynomial interpolation and spline interpolation (described below), is proportional to higher powers of the distance between the data points. These methods also produce smoother interpolants.
Polynomial interpolation

Plot of the data with polynomial interpolation applied Main article: Polynomial interpolation

Polynomial interpolation is a generalization of linear interpolation. Note that the linear interpolant is a linear function. We now replace this interpolant by a polynomial of higher degree. Consider again the problem given above. The following sixth degree polynomial goes through all the seven points:

Plot of the data with spline interpolation applied Main article: Spline interpolation

Substituting x = 2.5, we find that f(2.5) = 0.5965.

Remember that linear interpolation uses a linear function for each of intervals [xk,xk+1]. Spline interpolation uses low-degree polynomials in each of the intervals, and chooses the polynomial pieces such that they fit smoothly together. The resulting function is called a spline.

For instance, the natural cubic spline is piecewise cubic and twice continuously differentiable. Furthermore, its second derivative is zero at the end points. The natural cubic spline interpolating the points in the table above is given by

In this case we get f(2.5) = 0.5972. Like polynomial interpolation, spline interpolation incurs a smaller error than linear interpolation and the interpolant is smoother. However, the interpolant is easier to evaluate than the high-degree polynomials used in polynomial interpolation. It also does not suffer from Runge's phenomenon.

You might also like