My thesis draft

advertisement

CONTENTS

Chapter 1 Introduction…………………………………………….

Chapter 2 Overview of

Digital

Image

Processing …………………….

2.1 Binary images, Grayscale images & Color Image

2.2 Neighborhoods and Connectivity

2.3 Basic steps in Image Processing for spatial data

Chapter 3 Image Segmentation with Floodfill……………………

3.1 Image Growing Approach

3.2 Image Growing with Labeling Algorithm

3.3 cost of labeling algorithm

Chapter 4 User Region Selection…………………………………

4.1 Selection of Polygon region

4.2 Building an image filter by Polygon filling

Chapter 5 Edge Detection…………………………………………

5.1 Introduction of Edge detection

1

5.2 Gradient Edge Detection—First derivative Operators

5.3 Laplacian Edge Detection (Gaussian filtering)—Second derivative

Operators

5.4 An edge detection approach

5.5 Using edge detection for image segmentation

Chapter 6 Object Comparison……………………………………

6.1

Comparing two binary objects with user selected reference points

6.2 An approach to optimize the overlapping of two objects

Chapter 7 Conclusion and Future Work………………………….

Chapter 8 Reference…………………………………………….

2

LIST OF FIGURES

2.1

RGB Color Cube

2.2

The HIS Color Model

2.3

4 –

Connected Neighbors

2.4

8 – Connected Neighbors

2.5

Fundamental Steps in Image Processing

3

Chapter 1

Introduction

Information plays more and more important role in our life. Information collection is a time consuming and expensive process. To overcome the cost and to expedite the process, the information of terrain is collected from airplanes or satellites through sensors, where the information is represented by image.

The spatial data can be applied to many areas. For example, based on the collected images, we can analyze the available water resources (area of lakes, width of canals, etc) for any specific region, assess the impacts of a hurricane, earthquake, or tornado on a specific region, and compute the erosion of islands or coastal areas. Besides, with highresolution spatial data from airborne lasers, insurance companies can assess property damages caused by extreme event quickly and accurately.

The key issue to achieve the end is image processing. Many available digital image processing algorithms and techniques focus on improving the visual appearance of a digital image and automatic image recognition and/or description. The goal of this project, however, is to compare the object in spatial data. Thus, our research has been focusing on enhancing the image so as to get the difference between objects in different images.

4

Now, most image-editing software such as Adobe Photoshop, HSC, Live Picture,

Micrografx Picture Publisher, Fauve Xres, or Corel PhotoPaint can let you do colorcorrect, retouch, and create dazzling effects from digital images [1]. But a lot of useful functions, such as object abstracting, object comparing and edge detecting etc. aren’t included in them. Wavelet Toolkit in Matlab allow one to analyze an image with different wavelet-base functions, but it’s only used for research purpose and has many limitations, such as it can not process true color image, etc.

We designed several modules to analyze spatial data, including calculating area of a special region, comparing two different regions, etc. We used labeling algorithm to increase the efficiency of the processing of a huge image. Then we combine the Edge

Detection and floodfill with labeling algorithm to get the object more precisely. After getting the objects, we will use an algorithm to compare shapes of two different objects.

This algorithm can be used to find the global maximum overlap between two objects. We can dramatically reduce the computing complexity of Image Comparison with this algorithm. All these modules make it possible to user to analyze the spatial data.

5

Chapter 2

Overview of Digital Image Processing

Images are essentially a function of some spatial coordinates: in two-dimension as f (x, y), where x and y denote spatial coordinates and the value of f at any point (x, y) is proportional to the brightness (or gray level) of the image at that point.

Rather than a continuous function, these functions are sampled at discrete points. A digital image refers to an image quantized both in spatial coordinate and brightness. A digital image can be considered a matrix and be arranged into an array. The elements of such image array are called picture element or pixels . These pixels can be organized and mapped to a video display to form a representation of a scene. Factors such as the size of an image (the number of pixels in an image) and the number of unique values which a pixel may possess all contribute to the amount of physical storage necessary to contain this data. Due to the errors introduced by sampling and quantization of the actual scene, the digital image is only an approximation of an actual scene.

2.1 Binary Images, Grayscale Images and Color Image

Some images only detect brightness--the color component is ignored. It was only natural that this type of image was used first, because it is easy to imagine chemicals or other detectors that react to light energy, but it's harder to develop detectors that react to different wavelengths.

6

The simplest types of images are those that are truly black and white ( binary images) .

Each pixel can be represented by a single bit. If space permits, many imaging systems will still use a full byte to store the data because it is easier to access. However, if storage is at a premium, you can pack the bits to get optimal storage utilization. Even then, there are usually padding bits so that individual scan lines still start at byte or word boundaries.

It is far more common that we get images that have varying shades of gray ( grayscale images) . The most common type uses one byte per pixel and stores pixel values in the range [0...255] (or [-128…127] for signed bytes).

A color image is a mapping of a multi-valued function. It is constructed with several

(usually three) ``grayscale-like’’planes, each corresponding to one of the function values.

Each plane is an array equal in size to that of the image. The significance of each plane is dependent upon the color model used to represent the image.

The purpose of a color model is to facilitate the specification of colors in some standard.

In essence, a color model is a specification of a 3-D coordinate system and a subspace within that system where each color is represented by a single point [2].

The color models in most common use for image processing are RGB, HSI and YIQ.

Below we are going to give a belief introduce to RGB model and HSI model. Because in this paper, we only use these two models.

RGB Color Model

The simplest and most common color model is RGB (red, green, blue) model, which is based on a Cartesian coordinate system (Figure 2.1). In RGB model, each color appears in

7

its primary spectral components of red, green, and blue. We use this for color monitors, scanners, image storage, etc.

Figure 2.1. RGB Color Cube

RGB model is used in the processing of aerial and satellite multiband image data. Aerial and satellite images are obtained by image sensors operating on the different spectral ranges. Each image plane has physical meaning, So color combination obtained using

RGB is convenient for spatial data.

HSI color model

HSI color model is a color model in which a color is represented in terms of its hue (H), saturation (S), and intensity (I). This model is popular because it allows for the manipulation of a color’s features in the same manner in which humans perceive color.

8

Figure 2.2 The HSI Color Model

The HSI model does not use primary colors to construct different color values. Hue is a color attribute that describes a pure color (pure red, pure yellow). Saturation is a measure of the degree to which a pure color is diluted by white light. By combining hue, saturation, and intensity, any color can be represent in corresponding H, S, I value (Figure

2.2, HSI model).

Using the HSI color model offers several advantages [1]:

1.

The intensity describes the brightness of a pixel and is decoupled from the color information of the pixel.

2.

Hue and saturation are related to the way in which humans view color.

These features make the HSI model an ideal tool for developing color image processing algorithm. We used the HSI model for region segmentation. Since objects are often composed of regions with similar colors, the hue values across that region should be relatively similar. In these regions, the RGB values may change in a larger range.

9

Conversion from an RGB representation to an HSI model can be performed using simple algebraic and trigonometric equations:

H = cos

1



1  

R

G

 

R

B

 

2

R

G

 

R

B



G

B

 1

2



S = 1 – min (r

0

, g

0 , b

0

)

= 1 - 

R

3

G

B

 min

R , G , B

 

1

I =

3

R

G

B

2.2 Neighborhoods and Connectivity

One simple relationship between pixels is connectivity. Connectivity between pixels is an important concept used in establishing boundaries of objects and components of regions in an image.

Many image-processing algorithms involve operations between neighboring pixels on a rectangular lattice. Suppose that we consider as neighbors only the four pixels that share an edge (not a corner) with the pixel in question: (x+1, y), (x-1, y), (x, y+1), and (x, y-1).

These are called "4-connected" neighbors for obvious reasons (Figure 2.3).

10

Figure 2.3

: 4-connected neighbors.

An alternative is to consider a pixel as connected not just pixels on the same row or column, but also the diagonal pixels. The four 4-connected pixels plus the diagonal pixels are called "8-connected" neighbors (Figure 2.4).

Figure 2.4

: 8-connected neighbors.

Another form of connectivity is "mixed-connectivity", a form of 8-connectivity that considers diagonally-adjacent pixels to be connected if no shared 4-connected neighbor exists. (In other words, use 4-connectivity where possible and 8-connectivity where not.)

Depending on the problem, we use either 4-connectivity or 8-connectivity in our different image-processing algorithms. For example, when we using polygon to select the region we consider 4-connectivity, because if we take into account 8-connectivity, the edge of polygon may separate different region which is incorrect and not what we want to see.

11

2.3 Basic Steps in Image Processing for Spatial Data

Digital image processing encompasses a broad range of hardware, software, and theoretical underpinnings. As shown in Fig 2.5, the basic steps in image processing includes:

1.

Image acquisition: The spatial data we used is from NASA. NASA collected information of the terrain from airplanes or satellites. All data are stored in a semantic database. Most of spatial data represented by image with different band.

Our Terrafly will search the data in semantic database and mix the several images with different bands into one color image. My application will use the image data form Terrafly.

2.

Preprocessing: After getting spatial image, some preprocessing function can be used to process image, such as rotation, lowpass spatial filter, highpass spatial filter etc.

Rotation is used to turn an image. This is useful when comparing objects in images.

The Lowpass Spatial filters operate to smooth high spatial frequencies and accentuate low spatial variations in an image. These filters are characterized by positive values in their masks, which yields an additive, hence smoothing effect between neighborhood pixels during the convolution process. Their overall effect is to smooth edges. Using lowpass filter before Sobel filter will help to extract edges from gradient of an image.

The Highpass spatial filters operate to attenuate low frequency spatial variations and accenuate high spatial frequencies. These filters are characterized by negative values

12

in their masks, which clearly yields a subtractive effect between neighborhood pixels during the convolution process. These filters’ overall effect is to sharpen edges.

3.

Segmentation: The goal of segmentation is to separate the object’s pixels within an image from the background pixels. In this thesis, pixels growing technique to separate an object from background based upon the intensity or hue value of an image. Other segmentation techniques use the intensity or hue value discontinuities within an image to detect lines or points within the image. These discontinuities are then used to separate objects within an image from the background.

4.

Object comparison: comparing two objects in images. We will compare their image shapes first. Then, if necessary, further compare their other properties. By comparing the image shapes of two objects, we will find a global optimized position to overlap the two images. Then we can calculate the common part and different part in two images.

13

TerraFly

Image

Acquisition

Preprocessing Segmentation

Semantic DataBase

Object comparison

Figure 2.5. Fundamental Steps in Image Processing

L

T

R

E

S

U

14

Chapter 3

Image Segmentation with Floodfill

To analyze spatial data, extract the object from spatial image and calculate the area of object, first step is image segmentation. Segmentation is the process of identifying coherent regions in images that correspond to objects.

The goal of segmentation is to partition an image into regions. Automated segmentation is probably the most difficult problem in computer vision due to the following reasons:

1.

Much information is lost when 3-D scenes are projected to two dimensions. When objects cross in front of other objects (which we call "occlusion"), it is hard to keep the pieces together.

2.

Segmentation attempts to produce primitive object regions. The notion, however, of what constitutes a primitive object is nebulous.

We use our brains extensively in our perceptual processes. The fact that we can easily recognize that certain parts belong or don't belong to a common object is not because they have the same properties, but because we know that they form parts of the same known and recognizable object. Endowing computers with such cognitive ability is currently beyond our capability.

Let us R be the entire image region. Formally, we may view segmentation as a process that partitions R into n subregions, R1, R2… Rn, such that

(a)

Ri = R, i n

1

15

(b)

Ri is a connected region, i = 1, 2, ….., n,

(c) Ri  Rj =

 for all i and j, i

j,

(d)

P(Ri) = TRUE for i = 1, 2, …., n, and

(e) P(Ri  Rj) = FALSE for i

j, where P (Ri) is a logical predicate over the points in set Ri and

is a null set.

3.1 Image Growing Approach

There are several available approaches to image segmentation, most of them focus on finding specific features in an image: points, lines, edges, etc, then partition image with these features. We will use part of edge detection techniques in chapter 5. In this section, we will use another image segmentation approach called image growing . Image growing is a procedure that groups pixels or subregions into a larger region. It is widely used in image segmentation.

We think some region on an image as an object because we have our image processing ability in our brain. We decide some region belongs to an object not only by the similar property of these regions, but also because we know this object and recognize this object intuitively based on the similar properties. Sometimes, it is not a trivial task for us to extract the object. In many cases, the whole object region or the whole background region do have the similar properties, for example, similar color or intensity. These properties can be used to segment the object from background by region growing.

16

The fundamental difficulties with region growing are as following:

1.

Selection of initial seeds that properly represent regions of interest with suitable properties.

2.

Selection of an efficient algorithm to connect pixels or subregions.

One of the simplest image growing approaches is pixel aggregation. It proceeds in two main steps:

1.

From a single seed pixel seek the pixels in its 8-connected pixels which satisfy some criteria, for example, the absolute difference in gray level between the seed and this candidate point do not exceed 5 in 255 total gray level. Add all these pixels to the region and mark all these 8-connected pixels

2.

When a pixel is just added to the region (haven’t checked the neighbor pixels), repeat step1 based on this pixel. If there are no any new pixel is added to the region, then stop.

This algorithm is simple to understand but not efficient, because too many recursive calls are needed when implementing this algorithm if the region is larger.

In order to overcome the problem in pixel aggregation, we present a labeling algorithm for region segmentation in next section.

3.2 Image Growing with Labeling Algorithm

The basic idea of the labeling algorithm is scanning an image pixel by pixel, from left to right and from top to bottom, assigning a label to each pixel. The label assigned follows the following rules:

17

1.

If a pixel doesn’t have the required property, assign the label –1 to it.

2.

If a pixel has the required property, check all the left and top neighbor pixels (these pixels already have labels). If all these labels are –1, assign a new label to this pixel

(increasing the maximum used label by one). If only one of these labels is positive

(not –1), then assign this label to this considered pixel. If two or more of these labels are not positive (–1), assign one of these label to this considered pixel and make a note of the label equivalencies for all these different positive labels.

After completing the scan of the image, find the label of seed pixel and all the equivalent label of this label. All the pixel with these labels will form the region we want.

Figure 3.1(different cases).

We use a label array to save the equivalent labels information. Initially the value of each element of the array takes the value of index.

Label: index value

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

When we store equivalence of label 5 = label 8, we just set both label [5] and label [8] to

5 (min (5, 8)). index 1 value 1

2

2

3

3

4

4

5

5

6

6

7

7

8

5

18

If now we store equivalence of label 5 = label 3, the result will be index 1 2 4 6 7 value 1 2

3

3 4

5

3 6 7

8

5

The pixel with the label 3, 5, 8 will form a region.

In more complicated case: for example, index

3 4 5 6 7 8 9

19

25 value

3 4 3 6 4 5 7

9

8

Now the label 3,5,8 and 25 will form a region, while label 4,7,9 and 19 will form another region. If we store equivalence 9 and 8, we will find the smallest label in 8’s group is 3 and that in 9’s group is 4. The smallest label in these two groups will be 3, so all values of array 8, 5, 3 and 9, 7,4 will be changed to 3. The result will be index …

3 4 5 6 7 8 9 … 19 …

25 value

3 3 3 6 3 3 3

9

8

The basic idea of this algorithm is to reduce the length of the link list of the equivalence labels. The original link list is

25 -> 8 ->5 -> 3 and 19->9->7->4 after adding equivalence of 9 and 8, the link list is reduced to (25,19)->(9,8,7,5,4) -> 3, only three level. Merging the list with this algorithm will reduce the computation time.

19

Because next time when we merge two list by two-label equivalence, the lists we search become shorter.

After inserting all equivalence, we get the table as following: index

3 4 5 6 7 8 9

19

25 value

3 3 3 6 3 3 3

9

8

Then we scan the array from smallest index of array

If Label [i]= i, we leave the value in i.

If Label[i]

 i, (of course i > Label[i]) we assign the value of Label[Label[i]] to Label[i]. In this way, each label has label value which represents the smallest label it connected. index

3 4 5 6 7 8 9

19

25 value …

3 3 3 6 3 3 3 … 3 …

3

After building the array Label, we check the seed pixel’s label value (k) then we assign the value Label [k] to a reference variable r. This reference value means the smallest pixel label connects to the seed point. We will scan all the pixels in this image and check out all the pixels j with Label [j] = r. We will build a binary image which has the same width and height. When we find a pixel connected to seed, we will set the binary pixel in this position to 1; Otherwise we set the binary pixel 0.So finally we can build a binary image with the extract object on it. With this binary image, we can calculate the area of this object by counting all the pixels which are not valued zero. If we know the scalar of

20

image (one pixel represent some length in real world), we can estimate the area of this object in real world.

This binary image can also be used to compare objects in chapter 7.

3.3

Cost of Labeling Algorithm

The cost of labeling algorithm is linear with the number of pixels in an image. To prove it, we will analyze the cost of this algorithm. From the discussing above, we need scan the whole image that suppose the number of pixels is n. The cost of scanning an image pixel by pixel two times will be 2n = O (n). Another part of cost is insertion of equivalence of labels into the array Label. This cost will also be O (n). We prove it as following:

1.

In the worst case, the largest label index of pixel will be n. This means the total length of all lists will be at most n. Suppose that there are totally m insertions, the cost of each insertion will be: Case 1, if the insertion does do anything, the cost of this operation is O (1). Case 2, if the insertion reduce the length of link lists, the cost of this operation will be proportional to the number of total reduced length of the link lists. For m insertions, the total cost will be O (m + n). The value of m will less than n., so O (m + n) = O (n).

2.

O (n) is the worst-case cost. In reality the cost will far less than O (n), because the total length of lists and the number of insertion will both far less than n.

It follows from the above analysis that the label algorithm is a linear-time algorithm.

21

Chapter 4

User Region Selection

In most cases, we are just interested in some region in a large-scale spatial image.

Selecting the region we are interested and then processing this part of image can save us a lot of time and make the processing more efficient. Most of image processing software can select the rectangle region, but it is not good enough in many cases. When do the region growing, sometime the boundary of object is not complete closed, for example, a lake with several rivers connect to it. If using the region growing without selecting the lake region first. The river will be treated as the part of the lake object if the river has the similar properties as the lake, for example, hue or intensity value. In this case, if only selecting the lake region by rectangle, sometimes it’s not fit in a rectangle. So we build an algorithm to select a polygon region. With this algorithm, the lake can be cut out from the rivers and the region growing (floodfill) will only work for object-the lake.

4.1 Selection of Polygon Region

In order to select a polygon region from an image, we will let users to select the vertex of polygon, then the application will automatically build a binary image filter, which has the

1 values inside the polygon which the user selected and 0 values outside the polygon.

Multiply this binary filter to the original image then all the pixels outside the polygon will be zero. Using this method we can select the polygon region from the spatial image.

22

To build this binary polygon filter, we must draw a polygon on a region which has same size as the original image. To draw a polygon, we simply draw its edges. We move from the first vertex to the successive vertex and draw a line between these two points. Repeat this step when a user selects a new vertex. When the user stops selecting any new vertex, draw a line between last vertex and first vertex.

4.2 Building a image filter by Polygon filling

An infinitely long horizontal line in the same plane as the polygon will intersect the boundaries of the polygon a certain number of times. This number can range from zero up to the number of the polygon edges. Figure 5.1 shows some possible situations when a horizontal line intersects the polygon boundaries. And odd number of intersection can occur only if the line goes through a vertex. In all other cases, the number of intersections must be even.

When we fill the polygon, we set all the pixels within or on the polygon boundary to the fill color. Theoretically we can do an inside-outside test to each pixel and then decide whether to color it. The problem is the tests are expensive. The approach we used here is more efficient. Suppose we want to fill a polygon with certain color. We could scan the whole image from top to bottom and from left to right. When we reach or cross a polygon boundary, we set the pixels and all the following pixels to the fill color until we reach another edge. We don’t set the color until we again reach or cross a boundary. Crossing the polygon boundaries acts like a switch that determines whether the pixels should be set color or not.

23

Theoretically, there is no problem in this approach. But practically it’s difficult to decide one or two edges are crossed if the scan line is near or on the vertex.

One approach is to calculate a scan line where it will cross the boundaries. By the calculation, we can know the scan line is crossing one or two edges and decide whether to set pixels color. If there are a lot of edges, the calculation will be expensive.

Another approach is checking whether the scan line cross two edges when it find the two or more continue edge pixels. If it is passing the vertex or near the vertex, we don’t change anything. If it is far from any vertex, we change the color state.

After drawing and filling a polygon, we get a filter with 1 inside the polygon and 0 outside. It’s also a binary image. Using this binary filter, we can erase image region inside or outside polygon which user selected. This is a useful function when dealing with large spatial data.

Chapter 5

Edge Detection

24

In chapter 3, we discussed one approach of image segmentation. Another approach is to detect the edge and link edge to form object. The difficulty of this approach is in finding the closed edge efficiently. We will try to combine these two approaches together and find a simple and practical solution for object extraction.

5.1

Introduction to Edge Detection

Edge detection has been an important subject in image processing because the edges correspond in general to important changes in physical or geometrical properties of objects in the scene. Edge detection is the process that attempts to characterize the intensity (for gray image) in the image. It is hard to over-emphasize the importance of the edge detection in image understanding since most models in a conceivable vision system depend, directly or indirectly, on edge maps of input images for scene analysis and interpretation. Consequently, there has been a substantial effort in this direction. Despite this effort, many people believe that the problem is largely unsolved. So automatic image segmentation by edge detection is still an unsolved problem due to the complexity of image. It has given a way to a variety of semiautomatic approaches. In many cases, manual segmentation is still widely used when an image component must be segmented from a complex background. For this reason, our approach still includes some manual modification of edge, which will be helpful to get the object interested accurately and efficiently.

25

Early edge detection techniques [?] use local operators to estimate the first derivatives or the gradient of the image function at each point. The local maxims of the gradient are considered edges.

5.2 Gradient Edge Detection—First Derivative Operators

Most edge detectors are based in some way on measuring the intensity gradient at a point in the image. The gradient of an image f (x, y) at location (x, y) is

 f =

G x

, G y

 f

 x

,

 f

 y

Common practice is to approximate the gradient with absolute values.

 f

G x

G y

Another important quantity is the direction of the gradient vector. The angle is measured to represent x-axis.

(x, y) = tan

-1



G y

G x



As with any vector, we can compute its magnitude and orientation. The gradient orientation gives us the direction of steepest ascent for intensity in the image, and the magnitude gives us the steepness of that ascent.

Most edges such as sharp dropoffs are often gradual transitions from one intensity to another. What usually happens in this case is that we get a rising gradient magnitude, a

26

peak of the gradient magnitude, and then a falling gradient magnitude. Extracting the ideal edge is thus a matter of finding this curve with optimal gradient magnitude.

In our approach of gradient edge detector, we use the Sobel operators. The Sobel operators have the advantage of providing both a differencing and smoothing effect [1].

Because derivatives enhance noise, the smoothing effect is a particular attractive feature of the Sobel operators.

The Sobel operator mask are as following:

-1 -2 -1

0 0 0

1 2 1 and

-1 0 1

-2 0 2

-1 0 1

These two operator are the masks to compute Gx and Gy at center point of the 3

3 region in an image. The cost of computing of the gradient pixel by pixel will be linear time

O(n).

After getting the gradient image, ideally gradient image will yield pixels lying only on the boundary between regions. In practice, these pixels seldom form a complete close

27

boundary. Some edge-linking algorithm is necessary to assemble edge pixels into meaningful boundaries.

5.3 Laplacian Edge Detection (Gaussian filtering)—Second

Derivative Operators

In recent years, several more sophisticated edge detection techniques have been proposed.

Marr and Hidreth [31] proposed the Laplacian Gaussian (LoG) detector. The zero crossings in a LoG filtered image are considered edge points. The Gaussian function is selected because it optimizes the uncertainty relation for the localization requirements in an spatial frequency domains.

The Laplacian if s 2-D function f (x, y), denoted by

 2 f (x, y), is defined by

 2 f (x, y) =

 2 f ( x

 x

2

, y )

 2 f ( x

 y

2

, y )

Find the zero crossings of the Laplacian and compare the local variance at this point to a threshold. If the threshold is exceeded, declare an edge.

Zero crossings of this operator can be used to find edges, but it is susceptible to noise. In general, the higher the derivative, the more sensitive the operator. This sensitivity comes not just from the sensitivity of the zero-crossings, but also of the differentiation.

To deal with the sensitivity of the Laplacian operator is to blur it. We don’t really need

“every” edge in the image, only the main features. This blurring is accomplished by

28

G ( x , y )

 exp

 x

2  y

2

2

2

 convolving the image with a gaussian. Gaussian is a general low pass filter has ripples, and ripples show up as edges. The image looks “smooth”.

Convolution is associative and commutative, so we can combine the Gaussian smoothing operator with the Laplacian operator (by convolving them one with another) to form a single edge-finding operator.

The use of LoG convolution masks was first suggested by Marr [31].

 2

G ( x , y )

1

2



4

 2



 x

2

2 y

2





 exp

 x

2 

2

2 y

2

Where

is the space constant of Gaussian.

According to Marr-Hildreth theory of edge detection, intensity edges occurring at different resolutions are located by convolving the image with a series of LoG filters having different spatial frequency parameters and then finding the contours where corresponding convolution output crosses zero. This theory was used with good results in various paper [8], [25].

The detection of edges with accurate position depends on w, the width of the excitatory region of the operator. In general, the zero-crossing contours of features having a size smaller than w are displaced [8]. The accuracy of LoG operators has been reported informally in [26] and studied in detail in [27]. The mask can be decomposed into

29

separate row and column filters to increase computation speed. The equation G(x, y) can be rewritten as the sum of two separable h

12

(x, y) and h

21

(x, y),

2 G(x, y) = K

 2



 x

2

2

2 y

2





 exp

 x

2  y

2

2

2

 , where K is a scale factor. Equation can be rewritten is the sum of two separable filters, h

12

(x, y) and h

21

(x, y), is follows:

 2

G(x, y) = h

12

(x, y)

+ h

21

(x, y) where h

12

(x, y) = h

1

(x)h

2

(y) h

21

(x, y) = h

2

(x)h

1

(y) h

1

(

) = K

 1

2

2



 exp



2

2

2

 h

2

(

) = K exp



2

2

2

In our implementation, all convolutions are performed using integer arithmetic. The function h

1 and h

2

are one-dimensional row and column filters which illustrate the decomposition of a small (11

11) LoG filter (

= , K= 4232).

5.4 Limitation of the Edge Detection

.

Theoretically speaking, the approaches for edge detection should be able to yield pixels lying only on the boundary between regions. In practice, however, this set of pixels seldom characterizes a boundary completely because of noise, breaks in the boundary from nonuniform illumination, and other effects that introduce spurious intensity or hue

30

discontinuities. Thus edge detection algorithms typically are followed by linking to assemble edge pixels into meaningful boundaries. Unfortunately the linking algorithms is not efficient enough to build a boundary in different cases. In most cases, output of the edge detection is just an edge image. To build a practically useful application, the image growing is more efficient to extract the interested object than edge detection. In this system, We still implemented the edge detection because it’s an important image processing function. We didn’t use it to calculate the object area because seldom we can get the complete close edge by edge detection.

5.5 Manual-Modified Floodfill

We already discuss the pixel growing with label algorithm in previous chapter. The result of floodfill will be a binary image. From this binary image, we can easily calculate the area of object. The problem is the floodfill get only the approximate boundary, so the calculation of object area also has error. We implemented a manual-modified approach to get a more accurate result efficiently.

1.

Getting a binary image by two floodfills. If the background region surrounding the object have the similar color or intensity. We select a seed pixel from this region in background and then do the floodfill. Because the background region surrounding the object have the similar property, the result of floodfill will separate this object from background and the object pixel will have the same binary value. Then we do the floodfill with selecting seed pixel in the object. After second floodfill, the result will

31

be a binary image with two regions, background and object. Obviously, calculating the area of object only need scanning and getting the number of pixels in the object.

If the object has the similar color or intensity near the edge, we only need exchange order sequence of the two floodfills - do the object floodfill first and then do the background floodfill next.

2.

Using the gradient edge detection to detect the edge of the binary image with only object and background. The result of using gradient filter and threshold will be another binary image with only the edge of that object. The edge in this image will be closed and form a complete boundary of the object.

3.

Combining the edge image and the original image. We may find that the edge we detected by gradient filter will not completely agree with the original image. We implemented a tool-Marker and user can use it to modify the edge by marking the right edge where floodfill make error. Then we repeat the two floodfills in 1, the object select by floodfill will have more accurate boundary.

4.

In case both the object and background are very complicated, no floodfill will succeed with color or intensity. If the user wants to calculat the area of object what the user can do with this application will be manual selecting the object with the polygon region selection. By calculating area of polygon, user can get the approximate value of the area of that region.

If we use the gradient filter with this binary image, the result will be another binary image with completely boundary edge. The problem is the floodfill only get the approximate boundary, so the edge detected also has some error in some part. We will add this edge to

32

the original image, find the place on the image where the edge we detected using floodfill isn’t agreed with the original image. We modify these places (mark the edge) and do the floodfill again. Do the floodfill with the modified image will create the object more accurately. After floodfill we can calculate the area of the object and show the result.

33

Chapter 6

Comparison of two binary object

Comparing two regions in two different images is a complicated task, because the difference between two regions will be in the shape, color and intensity. Our purpose to comparing two objects is to check the difference between two similar objects. To make problem simple, first we just compare the shape of objects. One simple approach is to put one region on top of another region, calculate the overlap area of these two regions. Then move and rotate one region, and find the maximum value of overlap between these two regions. This idea is simple, but if calculating the overlap area for all probable position, it’s very expensive. The running cost will be O (n 4

).

6.1 Global Optimization Problem

We use function f (x, y,

) to represent the overlap between two objects, where x and y are the coordinate of relative position of second object to first object.

is the angle of the second object rotating with the center point of object. The problem of comparing two objects becomes to find the combination of parameters which maximize the function f.

Because the maximum of a function f is a minimum of –f, thus we can apply general mathematical optimization theory to this problem.

The strict definition of the global optimum X * of f ( X) is that f ( X* )

f ( Y )

Y

V( X ), Y

X * where V( X ) is the set of feasible values of the control variables X. X is a vector.

A point Y* is strong local minimum of f (x) if

34

f( Y* )

 f( Y )

Y

N( Y* ,

), Y

Y *, where N( Y* ,

) is defined as the set of feasible points contained in the neighborhood of

Y*, i.e. within some arbitrarily small distance

 of Y* . For Y* to be a weak local minimum only an inequality need be satisfied f ( Y* )

f ( Y )

Y

N ( Y* ,

), Y

Y *.

6.2

Approaches to Comparing Two Objects

From the above analysis, to find a global minimum (maximum) we can first seek different local minimums (maximums). Then by comparing these local minimums (maximums), we can get global minimum (maximum).

There are several deterministic algorithms for finding local minim of multivariate functions whose arguments are continuous and on which no restrictions are imposed.

Global minimum is an entirely different and more challenging problem. Stochastic methods can be used for the global optimization.

Our approach is different from these algorithms for two reasons:

1. Our application needs real time response, so the global optimization should be got in reasonable time. Calculating the global optimization with these algorithms takes too much time.

2. The global optimization problem here has some different properties. The function change slowly here and the local region of the global maximum will be not trivial small.

In our approach, two main steps are as follows

35

1. Find the region mostly contain the global optimization. We will divide the image into many sub regions. We will calculate one overlap result with each sub region and find the maximum within these results. We think this sub region will be the region contains the global optimization if we get appropriate size of sub region.

2. If the region got in step 1 is small, we just need find local maximum and take it as global maximum. If the region is still large, repeat step 1 until the region is small

(small means only have one local maximum or it’s possible to calculation all value in this region.

With this algorithm, cost of finding the global maximum will be reduced to small percents of original cost.

Another approach will ask user to select reference point - select two reference points in two objects. If two objects we compare are similar, user can select two similar positions in the two images. This means user find the special region – the local optimization of this region is global optimization.

When we try to put one object on top of the another, we can first put the two reference points together, then calculate the overlapping area.

1.

Start with reference point, moves the top image with some small number of pixels in x direction and find a position with maximum value of overlap area.

2.

Start from the maximum point got in step 1, move the top image within a small range in y direction find a maximum overlap again.

36

3.

Repeat the steps 1 and 2 several times with small moving range. Then if there are no any further change of maximum overlap area, we stop and take the final position as global optimization.

With this approach, if the global optimization is also the starting reference point’s local maximum, the result will be the best overlap of two objects. If global optimization is far from the reference point, by increasing the range in steps 1 and 2, we always can find a global maximum position.

First approach gives an auto-comparison algorithm. Using algorithm we can efficiently find the global maximum. The second approach selects the reference point and only calculates the local maximum position which works more efficiently than the first approach. Because in most cases the reference point selected by users is close to the global maximum overlapping position, the computer will find efficiently the optimization position in the local region.

37

Chapter 8

Conclusion and Future Work

A labeled image-growing algorithm is designed to extract an object region with given properties. The cost of this algorithm is proportional to the number of pixels in the image under processing, hence it helps save the processing time for huge spatial data.

We implemented a special function which allows polygon region selection for extracting the object from the connected background that has similar properties to the object.

In order to overcome the limitations of pixel growing algorithm, we also designed an edge detection algorithm for image segmentation. Gradient (Sobel) edge detection filter and Laplacian -of- Gaussian (LoG) detector are implemented and we can use both of them as a new approach to edge detection. For extracting object region from the complicated background, user can mark some edges and the floodfill result should be more accurate. Finally, to compare two binary objects which are extracted from spatial images by pixel growing or edge detection, we designed an approach to calculate the maximum overlap position of the two objects so that the areas of common and different regions could be computed.

38

Reference

1.

Rafael C. Gonzalez, and Richard E. Woods [1992]. “Digital Image Processing”,

ADDISON-WESLEY PUBLISHING COMPANY, pp413~482

2.

James C. Tilton /NASA GSFC(tilton @chrpisis.gsfc.nasa.gov) January 31,1995

3.

Lucas J. van Vliet, Ian T. YOUNG, and Guus L.beckers, “An Edge Detection Model

Based on Non-Linear Laplace Filtering”, Pattern Recognition Group of the Faculty of

Applied Physics, Delft University of Technology, Department of Medical Informatics,

Erasmus University

4.

Rajiv Mehrotra, Shiming Zhen, “A Computational Approach to Zero-Crossing-Based

Two-Dimensional Edge Detection”, GRAPHICAL MODELS AND IMAGE

PROCESSING, Vol.58, No.1,January, pp. 1-17, 1996

5.

David W. Paglieroni, “Distance Transforms: Properties and Machine Vision

Applications”, GRAPHICAL MODELS AND IMAGE PROCESSING, Vol.54, No.1,

January, pp. 56-74, 1992

6.

David Eberly, Jack Lancaster, “On Gray Scale Image Measurements”, GRAPHICAL

MODELS AND IMAGE PROCESSING, Vol.53, No.6, November, pp. 538-549, 1991

7.

Jin Shen, Serge Castan, “An Optimal Linear Operator for Step Edge Detection”,

GRAPHICAL MODELS AND IMAGE PROCESSING, Vol.54, No.2, March, pp. 112-

133, 1992

8.

Andres Huertas , Gerard Medioni, “Detection of Intensity Changes with Subpixel

Accuracy Using Laplacian-Gussian Masks”, IEEE TRANSACTIONS ON PATTERN

39

ANALYSIS AND MACHINE INTELLIGENCE , VOL. PAMI-8, NO. 5, pp. 651-664,

SEPTEMBER 1986

9.

Eric N. Mortensen and William A. Barrett, “Ineractive Segmentation with Intelligent

Scissors”, GRAPHICAL MODELS AND IMAGE PROCESSING60, 349-384(1998),

ARTICLE NO.IP980480

10.

Paul l. Rosin, Geofe A. W. West, “Salience Distance Transforms”, GRAPHICAL

MODELS AND IMAGE PROCESSING, Vol.57, No.6, November, pp. 483-521, 1995

11.

Henri Maitre, “Contribution to the Prediction of Performances of the Hough transform”,

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE

INTELLIGENCE , VOL. PAMI-8, NO. 5, pp. 669-674 SEPTEMBER 1986

12.

John Canny, “A Computational Approach to Edge Detection”,

IEEE

TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE ,

VOL. PAMI-8, NO. 6, pp. 679-698 NOVEMBER 1986

13.

Vishvjit S. Nalwa, Thomas O. Binford, “On Detecting Edges”, IEEE

TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE ,

VOL. PAMI-8, NO. 5, pp. 699-713, NOVEMBER 1986

14.

Lee, J.M.S., R.M. Haralick and L.S. Shaporo, “Morphologic Edge Detection”,

Proc. 8 th

Inter.Conf. Pattern Recognition, Paris (France), pp. 369-373, 1986,

15

R. M. Haralick and L. Shapiro, “Survey-Image segmentation techniques”

, Comput.

Vision Graphics Image Process . 29, pp.100-132, 1985

16

D. M. McKeown and J. L. Denlinger, “Cooperative methods for road tracking aerial imagery”, in

Proceedings , CVPR 88, Ann Arbor, MI, June 5-9, 1988

40

17 J. Serra, Image Analysis and Mathematical Morphology, Academic Press, London,

1982

18

D. Terzopoulos, “Regularization of inverse visual problems involving discontinuities”, IEEE Trans. Pattern Anal. Mach. Intell . PAMI-8, pp.413-424. 1986

19 J. Shen and S. Castan, “Fast filter transform theory and design for image processing”,

Proceedings IEEE Conference on computer vision and Pattern Recognition(CVPR),

San Francisco, 1985

20

J. Shen and S. Castan, “An optimal linear operator for edge detection” ,

Proceedings

CVPR’86

, Miami, 1986

21

J. Shen and S. Castan, “Further results on DRF methods for edge detection,

Procedings, 9th ICPR, ROME , 1988

22

J. S. Chen and G. Medioni, “Detection, localization, and estimation of edges”,

PAMI

11(2), Feb. 1989

23

G. Borgefors, “Hierarchical Chamfer matching: A parametric edge matching algorithm”, IEEE Trans. Pattern Anal. Mach. Intelligence 10, 6, pp849-865, Nov.

1988

24 D. Marr and E. Hildreth “Theory of edge detection.” Proc. Roy. London,vol. B207, pp.187-217,1980.

25 M. Brady “Computational approaches to computer vision’” ACM Computer Surveys, vol. 14, no. 1, pp.3-71, Mar.1982.

26 E.C. Hildreth, “Implementation of a theory of edge detection”, Massachusetts Inst.

Technol.,Rep, AI-TR-579,Apr. 1980.

41

27 V. Berzins, “Accuracy of Laplacian edge detection,” Computer Vision, Graphics,

Image Processing,vol. 27, no. 2 pp. 195-210, Aug. 1984.

42

Download